New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 693513 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
OoO until Feb 4th
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocked on:
issue 702578
issue 702580
issue 702581
issue 702582
issue 702585

Blocking:
issue 674593


Show other hotlists

Hotlists containing this issue:
Non-Standard-IDL


Sign in to add a comment

WebIDL: Forbid certain types from being used in attributes

Project Member Reported by raphael....@intel.com, Feb 17 2017

Issue description

The WebIDL spec states that the following types "must not be used as the type of an attribute or constant":
* Dictionaries (https://heycam.github.io/webidl/#idl-dictionaries)
* Callback functions (https://heycam.github.io/webidl/#idl-callback-functions)
* Sequence types (https://heycam.github.io/webidl/#idl-sequence)
* Record types (https://heycam.github.io/webidl/#idl-record)

Records are currently not implemented and is being tracked separately in  issue 685754 , and the IDL parser in //tools/idl_parser already rejects those types as constants because of the WebIDL grammar itself.

Fixing this only adds a few lines of code to the WebIDL Python scripts, but existing offenders need to be fixed first (as of commit e8a65d35c402aa21c4ce9b07a63a109d113a6066 "Get rid of redundant layout tree update related to selection"):
* third_party/WebKit/Source/modules/app_banner/BeforeInstallPromptEvent.idl
* third_party/WebKit/Source/modules/payments/PaymentRequestEvent.idl
* third_party/WebKit/Source/modules/shapedetection/DetectedBarcode.idl
* third_party/WebKit/Source/modules/webusb/USBAlternateInterface.idl
* third_party/WebKit/Source/modules/webusb/USBConfiguration.idl
* third_party/WebKit/Source/modules/webusb/USBDevice.idl
* third_party/WebKit/Source/modules/webusb/USBInterface.idl
* third_party/WebKit/Source/modules/webusb/USBIsochronousInTransferResult.idl
* third_party/WebKit/Source/modules/webusb/USBIsochronousOutTransferResult.idl

The WebUSB code has already been updated upstream to use FrozenArray<> instead of sequence<> in attributes, but DetectedBarcode and PaymentRequestEvent are still using a sequence and a dictionary as attributes in the spec, respectively. BeforeInstallPromptEvent.idl does not seem to be implementing any spec.
 
> The WebUSB code has already been updated upstream to use FrozenArray<> instead of sequence<> in attributes

Sorry, I meant the WebUSB *spec*.

Comment 2 by peria@chromium.org, Mar 2 2017

Labels: Hotlist-Interop
Status: Available (was: Untriaged)
Blocking: 674593
Blockedon: 702578
Blockedon: 702580
Blockedon: 702581
Blockedon: 702582
Blockedon: 702585
Cc: foolip@chromium.org
Status: Started (was: Available)
Owner: raphael....@intel.com
Project Member

Comment 12 by bugdroid1@chromium.org, Jun 21 2017

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

commit f81fb7a57311120997cf080cb6349560c2c42270
Author: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Date: Wed Jun 21 12:44:33 2017

bindings: Forbid certain types from being used as attributes.

The WebIDL spec states that the following types "must not be used as the
type of an attribute or constant":

* Callback functions (https://heycam.github.io/webidl/#idl-callback-functions)
* Dictionaries (https://heycam.github.io/webidl/#idl-dictionaries)
* Record types (https://heycam.github.io/webidl/#idl-record)
* Sequence types (https://heycam.github.io/webidl/#idl-sequence)

The IDL parser in //tools/idl_parser already rejects those types as
constants because of the WebIDL grammar itself, but they were still allowed
as attributes.

Bug:  693513 
Change-Id: Ie1bc5bdeeacb77b5ce4a17b1ce0ac21702ef049c
Reviewed-on: https://chromium-review.googlesource.com/542817
Reviewed-by: Hitoshi Yoshida <peria@chromium.org>
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Raphael Kubo da Costa (rakuco) <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/master@{#481183}
[modify] https://crrev.com/f81fb7a57311120997cf080cb6349560c2c42270/third_party/WebKit/Source/bindings/scripts/idl_definitions.py
[modify] https://crrev.com/f81fb7a57311120997cf080cb6349560c2c42270/third_party/WebKit/Source/bindings/tests/idls/core/TestCallbackFunctions.idl
[modify] https://crrev.com/f81fb7a57311120997cf080cb6349560c2c42270/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp
[modify] https://crrev.com/f81fb7a57311120997cf080cb6349560c2c42270/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.h

Labels: M-61
Status: Fixed (was: Started)

Sign in to add a comment