|
IDL: Add toRestricted{Float,Double}() helpers to V8Binding.h
These implement conversion from V8 value to a float/double C++ that throws
a TypeError if the numeric value is NaN or infinite. This is how the IDL
types 'float' and 'double' should behave according to WebIDL, but in Blink
they currently only do if an interface/method/attribute has the extended
attribute [TypeChecking=Unrestricted].
This CL changes two observable things:
1) The error message changes from being specific to the method argument
being converted ("double parameter N is non-finite"), to being generic
("The provided double value is non-finite").
2) 'float'/'double' members in union types go from being always
unrestricted to always being restricted, which is correct per
specification.
Since [TypeChecking=Unrestricted] wasn't supported either for dictionary
members or union type members, it was previously impossible to get the
correct behavior for these type conversions. An unrestricted conversion
for a union member can be achieved by declaring the member as 'unrestricted
float' or 'unrestricted double', also per specification. A restricted
conversion for a dictionary member can now be achieved by adding
[TypeChecking=Unrestricted] on the dictionary as a whole or on the member.
BUG= 354298, 450252
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=188797
Total comments: 8
Total comments: 2
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+359 lines, -187 lines) |
Patch |
|
M |
LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite-expected.txt
|
View
|
|
1 chunk |
+7 lines, -7 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/canvas/canvas-getImageData-invalid-expected.txt
|
View
|
|
1 chunk |
+12 lines, -12 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/canvas/canvas-putImageData-expected.txt
|
View
|
|
1 chunk |
+18 lines, -18 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/canvas/gradient-addColorStop-with-invalid-offset-expected.txt
|
View
|
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/canvas/linearGradient-infinite-values-expected.txt
|
View
|
|
1 chunk |
+12 lines, -12 lines |
0 comments
|
Download
|
|
M |
LayoutTests/fast/canvas/radialGradient-infinite-values-expected.txt
|
View
|
|
1 chunk |
+18 lines, -18 lines |
0 comments
|
Download
|
|
M |
Source/bindings/core/v8/V8Binding.h
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/core/v8/V8Binding.cpp
|
View
|
|
2 chunks |
+24 lines, -0 lines |
4 comments
|
Download
|
|
M |
Source/bindings/scripts/v8_attributes.py
|
View
|
|
4 chunks |
+5 lines, -8 lines |
0 comments
|
Download
|
|
M |
Source/bindings/scripts/v8_dictionary.py
|
View
|
1
|
4 chunks |
+8 lines, -3 lines |
0 comments
|
Download
|
|
M |
Source/bindings/scripts/v8_interface.py
|
View
|
|
4 chunks |
+8 lines, -4 lines |
0 comments
|
Download
|
|
M |
Source/bindings/scripts/v8_methods.py
|
View
|
|
5 chunks |
+8 lines, -7 lines |
0 comments
|
Download
|
|
M |
Source/bindings/scripts/v8_types.py
|
View
|
1
2
|
5 chunks |
+10 lines, -5 lines |
0 comments
|
Download
|
|
M |
Source/bindings/scripts/v8_union.py
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/bindings/templates/attributes.cpp
|
View
|
|
1 chunk |
+1 line, -10 lines |
0 comments
|
Download
|
|
M |
Source/bindings/templates/methods.cpp
|
View
|
|
1 chunk |
+1 line, -10 lines |
0 comments
|
Download
|
|
M |
Source/bindings/tests/idls/core/TestDictionary.idl
|
View
|
1
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/tests/idls/core/TestObject.idl
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/tests/results/core/TestDictionary.h
|
View
|
1
|
4 chunks |
+10 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/tests/results/core/TestDictionary.cpp
|
View
|
1
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/tests/results/core/UnionTypesCore.h
|
View
|
|
1 chunk |
+46 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/tests/results/core/UnionTypesCore.cpp
|
View
|
|
4 chunks |
+75 lines, -3 lines |
0 comments
|
Download
|
|
M |
Source/bindings/tests/results/core/V8TestDictionary.cpp
|
View
|
1
|
4 chunks |
+36 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/tests/results/core/V8TestInterface.cpp
|
View
|
|
4 chunks |
+5 lines, -30 lines |
0 comments
|
Download
|
|
M |
Source/bindings/tests/results/core/V8TestObject.cpp
|
View
|
|
3 chunks |
+36 lines, -12 lines |
0 comments
|
Download
|
|
M |
Source/bindings/tests/results/modules/V8TestInterface5.cpp
|
View
|
|
3 chunks |
+4 lines, -24 lines |
0 comments
|
Download
|
Total messages: 12 (3 generated)
|