WebIDL: Forbid certain types from being used in attributes |
||||||||||||
Issue descriptionThe 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.
,
Mar 2 2017
,
Mar 10 2017
,
Mar 17 2017
,
Mar 17 2017
,
Mar 17 2017
,
Mar 17 2017
,
Mar 17 2017
,
Apr 7 2017
,
Jun 21 2017
,
Jun 21 2017
,
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
,
Jun 21 2017
|
||||||||||||
►
Sign in to add a comment |
||||||||||||
Comment 1 by raphael....@intel.com
, Feb 17 2017