|
bindings: Make the sequence conversion code more compliant with WebIDL.
The existing bindings still referenced WebIDL array types that were removed
from the spec in 2015, and converting JS types to IDL sequences with an
algorithm that expected either a JS array (in which case it just iterated
over each element) or an object that adhered to an outdated protocol where a
"length" property was expected.
The current WebIDL sequence conversion steps are simpler and described in
https://heycam.github.io/webidl/#es-sequence. In short, JS objects are
converted to sequences via @@iterator and the regular iteration protocol of
calling next() and checking the returned object.
This works with arrays as well as any object that implements a valid
Symbol.iterator property. It opens the way for custom iterators, the lack of
which was causing some layout tests to fail. In other words, any iterable JS
object can now be converted into a sequence<>.
The downside is that the Blink-V8 communication required for calling
@@iterator, invoking next() and checking objects on every iteration step is
costlier than what we had before, so the "fast case" has been preserved for
JS arrays (even though it is not 100% clear if this is a valid shortcut to
take, it at least does not introduce any regression compared to the previous
code).
This is part 1: several functions in V8Binding.h that implement the old
conversion algorithm (e.g. ToMemberNativeArray(), ToImplArray(),
ToV8Sequence() and ToImplSequence()) have not been removed yet, and their
callers in the code base have not yet been changed. This will come at a
later point in the future.
BUG= 690428
R=bashi@chromium.org,haraken@chromium.org,yukishiino@chromium.org
Review-Url: https://codereview.chromium.org/2826673004
Cr-Commit-Position: refs/heads/master@{#465649}
Committed: https://chromium.googlesource.com/chromium/src/+/941cc09b668fbbe90f3e8fd65e8773e1d38bd66f
Total comments: 1
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+918 lines, -257 lines) |
Patch |
 |
A |
third_party/WebKit/LayoutTests/bindings/sequence-type.html
|
View
|
|
1 chunk |
+207 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/crypto/subtle/aes-cbc/generateKey-failures-expected.txt
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/crypto/subtle/unwrapKey-badParameters-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/external/wpt/FileAPI/blob/Blob-constructor-expected.txt
|
View
|
|
1 chunk |
+4 lines, -6 lines |
0 comments
|
Download
|
 |
D |
third_party/WebKit/LayoutTests/external/wpt/fetch/api/headers/headers-record-expected.txt
|
View
|
|
1 chunk |
+0 lines, -14 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-expected.txt
|
View
|
|
2 chunks |
+2 lines, -9 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/fast/canvas/canvas-lineDash-input-sequence.html
|
View
|
|
1 chunk |
+18 lines, -5 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/fast/dom/idl-union-type-unittest-expected.txt
|
View
|
|
1 chunk |
+6 lines, -6 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/fast/events/constructors/message-event-constructor.html
|
View
|
|
2 chunks |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/fast/events/constructors/message-event-constructor-expected.txt
|
View
|
|
2 chunks |
+13 lines, -13 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/fast/events/message-event-max-ports.html
|
View
|
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/fast/events/message-event-max-ports-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/fast/files/blob-constructor.html
|
View
|
|
2 chunks |
+34 lines, -27 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/fast/files/blob-constructor-expected.txt
|
View
|
|
2 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/fast/files/file-constructor.html
|
View
|
|
2 chunks |
+14 lines, -7 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/fast/files/file-constructor-expected.txt
|
View
|
|
2 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamConstructor-expected.txt
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-expected.txt
|
View
|
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/platform/linux/external/wpt/FileAPI/blob/Blob-constructor-expected.txt
|
View
|
|
1 chunk |
+4 lines, -6 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/platform/win/external/wpt/FileAPI/blob/Blob-constructor-expected.txt
|
View
|
|
1 chunk |
+4 lines, -6 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/storage/websql/execute-sql-args.js
|
View
|
|
3 chunks |
+15 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/storage/websql/execute-sql-args-expected.txt
|
View
|
|
2 chunks |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/files/blob-constructor-expected.txt
|
View
|
|
2 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webaudio/dom-exceptions-expected.txt
|
View
|
1
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
A |
third_party/WebKit/PerformanceTests/Bindings/sequence-conversion-custom-iterator.html
|
View
|
|
1 chunk |
+30 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImpl.h
|
View
|
|
1 chunk |
+110 lines, -6 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImplTest.cpp
|
View
|
|
1 chunk |
+178 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/core/v8/ScriptValue.h
|
View
|
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/core/v8/V8Binding.h
|
View
|
|
3 chunks |
+8 lines, -10 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
|
View
|
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/scripts/v8_methods.py
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/scripts/v8_types.py
|
View
|
|
4 chunks |
+7 lines, -42 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl
|
View
|
|
1 chunk |
+1 line, -4 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/BooleanOrElementSequence.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/DoubleOrLongOrBooleanSequence.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/DoubleOrStringOrDoubleOrStringSequence.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/ElementSequenceOrByteStringDoubleOrStringRecord.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/LongSequenceOrEvent.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/NodeOrLongSequenceOrEventOrXMLHttpRequestOrStringOrStringByteStringOrNodeListRecord.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/StringOrStringSequence.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/StringSequenceCallbackFunctionLongSequenceArg.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
|
View
|
|
8 chunks |
+8 lines, -8 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp
|
View
|
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
|
View
|
|
22 chunks |
+22 lines, -22 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp
|
View
|
|
4 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/BUILD.gn
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/core_idl_files.gni
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/testing/Internals.h
|
View
|
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/testing/Internals.cpp
|
View
|
|
2 chunks |
+5 lines, -0 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/testing/Internals.idl
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
A |
third_party/WebKit/Source/core/testing/SequenceTest.h
|
View
|
|
1 chunk |
+49 lines, -0 lines |
1 comment
|
Download
|
 |
A |
third_party/WebKit/Source/core/testing/SequenceTest.cpp
|
View
|
|
1 chunk |
+54 lines, -0 lines |
0 comments
|
Download
|
 |
A |
third_party/WebKit/Source/core/testing/SequenceTest.idl
|
View
|
|
1 chunk |
+24 lines, -0 lines |
0 comments
|
Download
|
Total messages: 17 (9 generated)
|