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

Issue 765673005: IDL: Null values should be converted for non-nullable dictionary members (Closed)

Created:
6 years ago by bashi
Modified:
6 years ago
Reviewers:
haraken, Jens Widell, zino
CC:
blink-reviews, blink-reviews-bindings_chromium.org, arv+blink
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

IDL: Null values should be converted for non-nullable dictionary members The current implementation of the binding layer treats null values as the same as undefined, but this behavior doesn't match what the spec specified. According to the spec[1], when null is passed to a dictionary member, we should do conversion unless the member is nullable. For example, given a dictionary member and the type of the member is DOMString, passing null should result in "null" (of type string). This CL changes the binding's behavior to follow the spec. [1] http://heycam.github.io/webidl/#es-dictionary BUG=321462 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=186169

Patch Set 1 #

Total comments: 5

Patch Set 2 : #

Total comments: 1

Patch Set 3 : GN fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+236 lines, -144 lines) Patch
M LayoutTests/fast/canvas/canvas-hit-regions-basic-test.html View 1 1 chunk +0 lines, -4 lines 0 comments Download
M LayoutTests/fast/canvas/canvas-hit-regions-basic-test-expected.txt View 1 1 chunk +0 lines, -4 lines 0 comments Download
M LayoutTests/fast/canvas/canvas-hit-regions-fill-rule-test.html View 1 1 chunk +1 line, -13 lines 0 comments Download
M LayoutTests/fast/canvas/canvas-hit-regions-fill-rule-test-expected.txt View 1 1 chunk +1 line, -6 lines 0 comments Download
M LayoutTests/fast/dom/idl-dictionary-unittest.html View 2 chunks +3 lines, -5 lines 0 comments Download
M LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt View 1 chunk +2 lines, -3 lines 0 comments Download
M Source/bindings/scripts/v8_dictionary.py View 1 5 chunks +18 lines, -8 lines 0 comments Download
M Source/bindings/templates/dictionary_impl.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M Source/bindings/templates/dictionary_v8.cpp View 1 2 chunks +18 lines, -9 lines 0 comments Download
M Source/bindings/templates/templates.gni View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/TestDictionary.h View 1 5 chunks +7 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestDictionary.cpp View 1 2 chunks +154 lines, -80 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp View 1 1 chunk +14 lines, -8 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp View 1 1 chunk +7 lines, -4 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
bashi
PTAL? I'd like to change the behavior of IDL dictionary to conform to the spec. ...
6 years ago (2014-11-28 05:14:16 UTC) #2
haraken
LGTM https://codereview.chromium.org/765673005/diff/1/Source/bindings/tests/results/core/V8TestDictionary.cpp File Source/bindings/tests/results/core/V8TestDictionary.cpp (right): https://codereview.chromium.org/765673005/diff/1/Source/bindings/tests/results/core/V8TestDictionary.cpp#newcode81 Source/bindings/tests/results/core/V8TestDictionary.cpp:81: } else if (block.HasCaught()) { Not related to ...
6 years ago (2014-11-28 05:50:25 UTC) #3
Jens Widell
LGTM https://codereview.chromium.org/765673005/diff/1/Source/bindings/templates/dictionary_impl.h File Source/bindings/templates/dictionary_impl.h (right): https://codereview.chromium.org/765673005/diff/1/Source/bindings/templates/dictionary_impl.h#newcode26 Source/bindings/templates/dictionary_impl.h:26: void {{member.resetter_name}}() { m_{{member.cpp_name}} = {{member.member_cpp_type}}(); } We ...
6 years ago (2014-11-28 06:36:18 UTC) #4
zino
On 2014/11/28 05:14:16, bashi1 wrote: > jinho.bang@, tests for addHitRegion() depend on the current behavior, ...
6 years ago (2014-11-28 07:09:12 UTC) #5
bashi
Thank you for reviews! https://codereview.chromium.org/765673005/diff/1/Source/bindings/templates/dictionary_impl.h File Source/bindings/templates/dictionary_impl.h (right): https://codereview.chromium.org/765673005/diff/1/Source/bindings/templates/dictionary_impl.h#newcode26 Source/bindings/templates/dictionary_impl.h:26: void {{member.resetter_name}}() { m_{{member.cpp_name}} = ...
6 years ago (2014-11-28 10:52:49 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/765673005/20001
6 years ago (2014-11-28 11:10:28 UTC) #8
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://src.chromium.org/viewvc/blink?view=rev&revision=186169
6 years ago (2014-11-28 11:32:36 UTC) #9
pfeldman
6 years ago (2014-11-28 11:45:45 UTC) #10
Message was sent while issue was closed.
A revert of this CL (patchset #2 id:20001) has been created in
https://codereview.chromium.org/768793002/ by pfeldman@chromium.org.

The reason for reverting is: Build failed:
http://build.chromium.org/p/chromium.webkit/builders/Linux%20GN/builds/13713/....

Powered by Google App Engine
This is Rietveld 408576698