Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Issue 2683853005: bindings: Make some value iterator properties aliases to Array.prototype functions (Closed)

Created:
3 years, 10 months ago by Raphael Kubo da Costa (rakuco)
Modified:
3 years, 10 months ago
CC:
chromium-reviews, blink-reviews, blink-reviews-bindings_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

bindings: Make some value iterator properties aliases to Array.prototype functions The WebIDL spec states that value iterators in an interface should cause the following operations to be added and be originally set to the corresponding property of ECMAScript's %ArrayPrototype%: * entries * forEach * keys * values Stop generating custom methods for those operations in the bindings when a value iterator is defined; instead, just set properties with those names to the corresponding intrinsics values from V8. This allows us to get a lot of code for free, avoid duplicating iterator code in Blink and remove the ValueIterable class altogether from the bindings code. However, doing so does require us to adjust non-conforming IDLs: https://heycam.github.io/webidl/#idl-iterable states that "a value iterator must only be declared on an interface that supports indexed properties", and "supports indexed properties" means an interface has an indexed getter operation as well as an integer-type attribute called "length". Some IDLs in Blink only had an "iterable<V>" declaration without the accompanying getter and "length" attribute. In the case of both CSSTransformValue and CSSUnparsedValue, a spec bug was also filed upstream to tackle this at the source. Finally, the bindings generation code now raises a ValueError if an interface only has an iterable<V> declaration without the accompanying indexed property getter and length attribute. BUG=545318, 632935 Review-Url: https://codereview.chromium.org/2683853005 Cr-Commit-Position: refs/heads/master@{#449857} Committed: https://chromium.googlesource.com/chromium/src/+/c85bc01513148e381d656d88a7f8a773704d6c34

Patch Set 1 #

Patch Set 2 : Patch v2: IDLs and test expectations adjusted #

Total comments: 3

Patch Set 3 : Patch v3: disable iterable<> on Global interfaces #

Patch Set 4 : Rebased patch #

Patch Set 5 : Rebased patch #

Patch Set 6 : Remove constexpr from Internals.h to fix the Android build #

Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -507 lines) Patch
M third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Node-childNodes-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/js/iterable-object-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt View 1 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/Iterable.h View 1 2 chunks +3 lines, -40 lines 0 comments Download
M third_party/WebKit/Source/bindings/scripts/idl_definitions.py View 1 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/scripts/v8_interface.py View 2 chunks +19 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/idls/core/TestInterface3.idl View 1 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/idls/modules/TestInterface5.idl View 1 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.h View 1 chunk +1 line, -5 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp View 6 chunks +20 lines, -130 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/test_interface_3.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.h View 2 chunks +1 line, -5 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp View 8 chunks +21 lines, -115 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/CSSTransformValue.h View 1 4 chunks +3 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/CSSTransformValue.cpp View 1 2 chunks +0 lines, -34 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/CSSTransformValue.idl View 1 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/CSSUnparsedValue.h View 1 4 chunks +3 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/CSSUnparsedValue.cpp View 1 2 chunks +0 lines, -30 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/CSSUnparsedValue.idl View 1 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/CSSUnparsedValueTest.cpp View 1 3 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/dom/BUILD.gn View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/DOMTokenList.h View 1 3 chunks +1 line, -4 lines 0 comments Download
M third_party/WebKit/Source/core/dom/DOMTokenList.cpp View 1 2 chunks +0 lines, -34 lines 0 comments Download
M third_party/WebKit/Source/core/dom/NodeList.h View 1 3 chunks +1 line, -6 lines 0 comments Download
D third_party/WebKit/Source/core/dom/NodeList.cpp View 1 1 chunk +0 lines, -40 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.h View 1 2 3 4 5 5 chunks +7 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.cpp View 1 2 3 4 2 chunks +0 lines, -23 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.idl View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 40 (16 generated)
Raphael Kubo da Costa (rakuco)
PTAL. This is the Blink half of the bug mentioned in the CL message. Even ...
3 years, 10 months ago (2017-02-08 08:05:02 UTC) #1
haraken
Do we have a test for this?
3 years, 10 months ago (2017-02-08 08:25:14 UTC) #2
Raphael Kubo da Costa (rakuco)
Looking at the failures in the Linux trybot it looks like we do :-) I'll ...
3 years, 10 months ago (2017-02-08 08:52:47 UTC) #3
Raphael Kubo da Costa (rakuco)
bindings: Make some value iterator properties aliases to Array.prototype functions The WebIDL spec states that ...
3 years, 10 months ago (2017-02-08 12:28:48 UTC) #4
Raphael Kubo da Costa (rakuco)
Patch v2 is up; my intention was to land these changes separately, but apparently that's ...
3 years, 10 months ago (2017-02-08 12:38:45 UTC) #6
haraken
On 2017/02/08 12:38:45, Raphael Kubo da Costa (rakuco) wrote: > Patch v2 is up; my ...
3 years, 10 months ago (2017-02-08 18:07:02 UTC) #8
meade_UTC10
On 2017/02/08 18:07:02, haraken wrote: > On 2017/02/08 12:38:45, Raphael Kubo da Costa (rakuco) wrote: ...
3 years, 10 months ago (2017-02-09 07:11:05 UTC) #9
Yuki
LGTM. https://codereview.chromium.org/2683853005/diff/20001/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl File third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl (right): https://codereview.chromium.org/2683853005/diff/20001/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl#newcode520 third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl:520: {%+ if is_global %}instanceTemplate{% else %}prototypeTemplate{% endif %}->SetIntrinsicDataProperty(v8AtomicString(isolate, ...
3 years, 10 months ago (2017-02-09 08:01:56 UTC) #10
Raphael Kubo da Costa (rakuco)
https://codereview.chromium.org/2683853005/diff/20001/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl File third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl (right): https://codereview.chromium.org/2683853005/diff/20001/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl#newcode520 third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl:520: {%+ if is_global %}instanceTemplate{% else %}prototypeTemplate{% endif %}->SetIntrinsicDataProperty(v8AtomicString(isolate, "entries"), ...
3 years, 10 months ago (2017-02-09 10:14:28 UTC) #11
Raphael Kubo da Costa (rakuco)
On 2017/02/08 18:07:02, haraken wrote: > Would it be helpful to disable some tests during ...
3 years, 10 months ago (2017-02-09 10:14:42 UTC) #12
Yuki
https://codereview.chromium.org/2683853005/diff/20001/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl File third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl (right): https://codereview.chromium.org/2683853005/diff/20001/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl#newcode520 third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl:520: {%+ if is_global %}instanceTemplate{% else %}prototypeTemplate{% endif %}->SetIntrinsicDataProperty(v8AtomicString(isolate, "entries"), ...
3 years, 10 months ago (2017-02-09 13:03:19 UTC) #13
Raphael Kubo da Costa (rakuco)
Patch v3 is up implementing Yuki's suggestion on interface_base.cpp.tmpl.
3 years, 10 months ago (2017-02-09 13:25:52 UTC) #14
Yuki
Thanks. Still LGTM.
3 years, 10 months ago (2017-02-09 13:28:44 UTC) #15
haraken
LGTM
3 years, 10 months ago (2017-02-09 14:39:24 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2683853005/60001
3 years, 10 months ago (2017-02-09 14:44:31 UTC) #19
Raphael Kubo da Costa (rakuco)
On 2017/02/09 14:44:31, commit-bot: I haz the power wrote: > CQ is trying da patch. ...
3 years, 10 months ago (2017-02-09 14:45:42 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2683853005/60001
3 years, 10 months ago (2017-02-11 10:54:32 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-clang/builds/37232) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 10 months ago (2017-02-11 10:57:04 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2683853005/80001
3 years, 10 months ago (2017-02-11 10:59:35 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_compile_dbg/builds/210413) android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, ...
3 years, 10 months ago (2017-02-11 11:23:23 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2683853005/100001
3 years, 10 months ago (2017-02-11 11:32:46 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/319978)
3 years, 10 months ago (2017-02-11 12:31:46 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2683853005/100001
3 years, 10 months ago (2017-02-11 13:03:07 UTC) #37
commit-bot: I haz the power
3 years, 10 months ago (2017-02-11 13:37:38 UTC) #40
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/c85bc01513148e381d656d88a7f8...

Powered by Google App Engine
This is Rietveld 408576698