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

Issue 15899009: Support indexed setter generation (Closed)

Created:
7 years, 7 months ago by kojih
Modified:
6 years, 10 months ago
CC:
blink-reviews, jsbell+bindings_chromium.org, eae+blinkwatch, abarth-chromium, marja+watch_chromium.org, dglazkov+blink, apavlov+blink_chromium.org, adamk+blink_chromium.org, darktears, Nate Chapin, alancutter (OOO until 2018)
Base URL:
https://chromium.googlesource.com/chromium/blink@master
Visibility:
Public.

Description

Support indexed setter generation If JS value is null and [TreatNullAs=functionName], functionName(name/index) is called instead of normal setter. Using the feature, following custom implementation has been removed. - V8HTMLOptionsCollection::indexedPropertySetter - V8HTMLSelectElement::indexedPropertySetter - V8Storage::indexedPropertySetter R=haraken@chromium.org BUG=229740 TEST=TestEventTarget.idl NOTRY=true Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=151449

Patch Set 1 #

Total comments: 3

Patch Set 2 : Use TreatNullAs, TreatUndefinedAs in case of value is null/undefined #

Total comments: 7

Patch Set 3 : make helper function and useit #

Total comments: 7

Patch Set 4 : nit #

Patch Set 5 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -62 lines) Patch
M Source/bindings/scripts/CodeGeneratorV8.pm View 1 2 3 4 6 chunks +125 lines, -15 lines 0 comments Download
M Source/bindings/scripts/IDLAttributes.txt View 1 1 chunk +2 lines, -2 lines 0 comments Download
M Source/bindings/tests/idls/TestEventTarget.idl View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/tests/results/V8TestEventTarget.cpp View 1 2 3 4 1 chunk +5 lines, -1 line 0 comments Download
M Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp View 1 chunk +0 lines, -7 lines 0 comments Download
M Source/bindings/v8/custom/V8HTMLSelectElementCustom.cpp View 1 chunk +0 lines, -6 lines 0 comments Download
M Source/bindings/v8/custom/V8StorageCustom.cpp View 1 1 chunk +0 lines, -27 lines 0 comments Download
M Source/core/html/HTMLOptionsCollection.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/html/HTMLOptionsCollection.cpp View 1 2 1 chunk +19 lines, -0 lines 0 comments Download
M Source/core/html/HTMLOptionsCollection.idl View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLSelectElement.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/HTMLSelectElement.cpp View 1 2 3 4 1 chunk +10 lines, -0 lines 0 comments Download
M Source/core/html/HTMLSelectElement.idl View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/storage/Storage.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/storage/Storage.cpp View 1 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/storage/Storage.idl View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 23 (0 generated)
kojih
r? Diff of generated code: diff -u /mnt/hdd/diff/gen_sti/V8CSSStyleDeclaration.cpp /mnt/hdd/diff/gen_oc/V8CSSStyleDeclaration.cpp --- /mnt/hdd/diff/gen_sti/V8CSSStyleDeclaration.cpp 2013-05-28 13:21:58.619992603 +0900 +++ ...
7 years, 7 months ago (2013-05-28 06:51:28 UTC) #1
haraken
https://codereview.chromium.org/15899009/diff/1/Source/bindings/tests/results/V8TestEventTarget.cpp File Source/bindings/tests/results/V8TestEventTarget.cpp (right): https://codereview.chromium.org/15899009/diff/1/Source/bindings/tests/results/V8TestEventTarget.cpp#newcode190 Source/bindings/tests/results/V8TestEventTarget.cpp:190: bool result = collection->anonymousNamedSetter(propertyName, propertyValue, value->IsNull(), value->IsUndefined()); This is ...
7 years, 7 months ago (2013-05-28 07:02:43 UTC) #2
kojih
Behavior of FireFox and Opera are same to chromium. (at least when we pass null ...
7 years, 6 months ago (2013-05-28 09:35:34 UTC) #3
kojih
Using optional parameters means something like this? bool Storage::anonymousIndexedSetter(unsigned index, const AtomicString& value, ExceptionCode& ec, ...
7 years, 6 months ago (2013-05-28 09:41:05 UTC) #4
haraken
Thanks for the clarification. I looked at code and changed my mind:) I guess there ...
7 years, 6 months ago (2013-05-28 10:24:27 UTC) #5
kojih
[TreatNullAs=remove] will work for V8HTMLSelectElement, but will not work for V8HTMLOptionsCollection. because in that case ...
7 years, 6 months ago (2013-05-28 10:42:05 UTC) #6
haraken
Can't you add a helper function to HTMLOptionsCollection.h that calls collection->ownerNode()->remove(index)?
7 years, 6 months ago (2013-05-28 11:02:02 UTC) #7
kojih
Oh it seems good idea. I'll try.
7 years, 6 months ago (2013-05-28 11:20:54 UTC) #8
kojih
Support [TreatNullAs=*]/[TreatUndefinedAs=*]. r? Now diff of generated code: diff -u /mnt/hdd/diff/gen_master/V8HTMLOptionsCollection.cpp /mnt/hdd/diff/gen_oc/V8HTMLOptionsCollection.cpp --- /mnt/hdd/diff/gen_master/V8HTMLOptionsCollection.cpp 2013-05-29 ...
7 years, 6 months ago (2013-05-29 03:55:22 UTC) #9
haraken
https://codereview.chromium.org/15899009/diff/12001/Source/bindings/scripts/CodeGeneratorV8.pm File Source/bindings/scripts/CodeGeneratorV8.pm (right): https://codereview.chromium.org/15899009/diff/12001/Source/bindings/scripts/CodeGeneratorV8.pm#newcode3306 Source/bindings/scripts/CodeGeneratorV8.pm:3306: } You should add a $treatUndefinedAs case as well. ...
7 years, 6 months ago (2013-05-29 06:41:56 UTC) #10
kojih
https://codereview.chromium.org/15899009/diff/20001/Source/bindings/scripts/CodeGeneratorV8.pm File Source/bindings/scripts/CodeGeneratorV8.pm (right): https://codereview.chromium.org/15899009/diff/20001/Source/bindings/scripts/CodeGeneratorV8.pm#newcode3504 Source/bindings/scripts/CodeGeneratorV8.pm:3504: sub GenerateNativeVariableDefinitionCorrespondingToJSValueParameter I think I can simplify some more ...
7 years, 6 months ago (2013-05-29 08:40:54 UTC) #11
haraken
LGTM https://codereview.chromium.org/15899009/diff/20001/Source/bindings/scripts/CodeGeneratorV8.pm File Source/bindings/scripts/CodeGeneratorV8.pm (right): https://codereview.chromium.org/15899009/diff/20001/Source/bindings/scripts/CodeGeneratorV8.pm#newcode3185 Source/bindings/scripts/CodeGeneratorV8.pm:3185: for my $i (0 .. @$conditions-1) { Nit: ...
7 years, 6 months ago (2013-05-29 08:51:04 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kojih@chromium.org/15899009/27001
7 years, 6 months ago (2013-05-29 09:19:52 UTC) #13
commit-bot: I haz the power
Retried try job too often on win_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_layout_rel&number=7364
7 years, 6 months ago (2013-05-29 11:59:12 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kojih@chromium.org/15899009/27001
7 years, 6 months ago (2013-05-29 12:15:49 UTC) #15
commit-bot: I haz the power
Retried try job too often on win_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_layout_rel&number=7409
7 years, 6 months ago (2013-05-29 14:58:45 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kojih@chromium.org/15899009/27001
7 years, 6 months ago (2013-05-29 22:25:49 UTC) #17
commit-bot: I haz the power
Failed to apply patch for Source/bindings/tests/results/V8TestEventTarget.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 6 months ago (2013-05-29 22:25:54 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kojih@chromium.org/15899009/44001
7 years, 6 months ago (2013-05-30 02:19:47 UTC) #19
commit-bot: I haz the power
Retried try job too often on win_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_layout_rel&number=7609
7 years, 6 months ago (2013-05-30 05:52:21 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kojih@chromium.org/15899009/44001
7 years, 6 months ago (2013-05-30 06:35:37 UTC) #21
commit-bot: I haz the power
Change committed as 151449
7 years, 6 months ago (2013-05-30 06:36:19 UTC) #22
Nils Barth (inactive)
6 years, 10 months ago (2014-01-31 03:03:36 UTC) #23
Message was sent while issue was closed.
For reference, the [TreatNullAs=functionName] behavior was removed in:
Replace [TreatNullAs=functionName] with [StrictTypeChecking]
https://codereview.chromium.org/143943020/

This is because the behavior can be specified on the Blink side,
*so long* as type checking is done in the bindings, so a 0 value means
undefined (or null, if nullable), rather than "invalid type":
we can distinguish JS types on the bindings side.

As these CLs demonstrate, specifying "undefined/null = remove, with
removeFunction"
in the bindings bloats the IDL files and the Blink files, due to adding an
auxiliary removeFunction and then having to refer to it.

Also, so far there were only 2 uses of this, so putting this behavior in the
bindings
doesn't save complexity on the Blink side, and makes the CG rather more complex.

Powered by Google App Engine
This is Rietveld 408576698