New issue
Advanced search Search tips

Issue 890375 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 11
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 3
Type: Bug


Participants' hotlists:
Hotlist-Bindings-IDLCompiler


Sign in to add a comment

Web IDL compiler allows bogus nullable dictionaries

Reported by bzbar...@mit.edu, Sep 28

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:64.0) Gecko/20100101 Firefox/64.0

Steps to reproduce the problem:
1. Try to write some Web IDL in which a dictionary-typed dictionary member is nullable.  See DeviceMotionEventInit as of today for example: https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/device_orientation/device_motion_event_init.idl?sq&g=0&l=7-12
2. 
3. 

What is the expected behavior?
IDL compiler rejects invalid IDL.

What went wrong?
IDL compiler allowed invalid IDL, which people then tried to put in a spec.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 71.0.3559.6 (Official Build) dev (64-bit)  Channel: n/a
OS Version: OS X 10.12
Flash Version: Shockwave Flash 29.0 r0

https://heycam.github.io/webidl/#idl-dictionaries explicitly says:

> If the Type is an identifier followed by ?, then the identifier must identify an interface, enumeration, callback function or typedef.

and

> If the type of the dictionary member, after resolving typedefs, is a nullable type, its inner type must not be a dictionary type.

when discussing dictionary members.
 
Components: Blink>Bindings
Labels: OS-Android OS-Chrome OS-Fuchsia OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
Owner: peria@chromium.org
Status: Assigned (was: Untriaged)
Labels: -Pri-2 Hotlist-Bindings-IDLCompiler Pri-3
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 10

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5658b28c40444360ca89bccf39f9914c34592683

commit 5658b28c40444360ca89bccf39f9914c34592683
Author: Andrew Comminos <acomminos@fb.com>
Date: Thu Jan 10 15:23:33 2019

Prevent IDL code generation of nullable dictionaries as dictionary members.

As per the WebIDL spec, "if the type of the dictionary member, after
resolving typedefs, is a nullable type, its inner type must not be a
dictionary type".

Raises an exception when encountering a nullable dictionary type in a
dictionary. Update the IDL files for Credential Management to the
upstream version, which removes the nullability of these members.

Bug:  890375 
Change-Id: I179b0193c6c15fc1f51ec10b44a9096d4b3e286a
Reviewed-on: https://chromium-review.googlesource.com/c/1404411
Reviewed-by: Hitoshi Yoshida <peria@chromium.org>
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Andrew Comminos <acomminos@fb.com>
Cr-Commit-Position: refs/heads/master@{#621579}
[modify] https://crrev.com/5658b28c40444360ca89bccf39f9914c34592683/third_party/blink/renderer/bindings/scripts/v8_dictionary.py
[modify] https://crrev.com/5658b28c40444360ca89bccf39f9914c34592683/third_party/blink/renderer/modules/credentialmanager/credential_creation_options.idl
[modify] https://crrev.com/5658b28c40444360ca89bccf39f9914c34592683/third_party/blink/renderer/modules/credentialmanager/credential_request_options.idl

Status: Fixed (was: Assigned)

Sign in to add a comment