|
|
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
Total comments: 3
|
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
|
Total messages: 40 (16 generated)
|