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

Issue 353973002: IDL: fix code generation for attributes with [PutForwards] (Closed)

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

Description

IDL: fix code generation for attributes with [PutForwards] When an attribute forwards puts to another attribute, most details in the generated setter code depend on the target (forwarded-to) attribute's type and attributes rather than on those of the source attribute (that is being forwarded.) If the target attribute (or its interface) has [TypeChecking=Interface] and an interface type, the value set should be checked against that interface type. Likewise, if the source attribute (or its interface) has [TypeChecking=Interface] and an interface type, the value set should *not* be checked against it, since that's not what is being set. For instance, given [TypeChecking=Interface] interface Document { [PutForwards=href] attribute Location location; } the setter should not check that the value to set is a Location object, since it will actually be converted to a string and assigned to the location object's href attribute, which is a DOMString attribute. Also, whether the setter needs an ExceptionState also depends on the target attribute's type and [RaisesException], not the source attribute's, since it's the conversion to the target attribute's type and/or the target attribute's actual setter that would be needing (or not) the exception state. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176985

Patch Set 1 : some testcases #

Patch Set 2 : the fix #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -30 lines) Patch
M Source/bindings/scripts/v8_attributes.py View 1 4 chunks +32 lines, -26 lines 2 comments Download
M Source/bindings/tests/idls/TestNode.idl View 1 chunk +2 lines, -1 line 0 comments Download
M Source/bindings/tests/idls/TestObject.idl View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/V8TestNode.cpp View 3 chunks +33 lines, -1 line 0 comments Download
M Source/bindings/tests/results/V8TestObject.cpp View 1 5 chunks +72 lines, -2 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Jens Widell
PTAL I'm mostly moving setter-specific code from attribute_context() into setter_context(), where it could be argued ...
6 years, 5 months ago (2014-06-26 10:48:05 UTC) #1
haraken
LGTM https://codereview.chromium.org/353973002/diff/40001/Source/bindings/scripts/v8_attributes.py File Source/bindings/scripts/v8_attributes.py (right): https://codereview.chromium.org/353973002/diff/40001/Source/bindings/scripts/v8_attributes.py#newcode313 Source/bindings/scripts/v8_attributes.py:313: context['cpp_setter'] = setter_expression(interface, attribute, context) Shall we put ...
6 years, 5 months ago (2014-06-26 12:02:24 UTC) #2
Jens Widell
https://codereview.chromium.org/353973002/diff/40001/Source/bindings/scripts/v8_attributes.py File Source/bindings/scripts/v8_attributes.py (right): https://codereview.chromium.org/353973002/diff/40001/Source/bindings/scripts/v8_attributes.py#newcode313 Source/bindings/scripts/v8_attributes.py:313: context['cpp_setter'] = setter_expression(interface, attribute, context) On 2014/06/26 12:02:24, haraken ...
6 years, 5 months ago (2014-06-26 12:11:47 UTC) #3
haraken
On 2014/06/26 12:11:47, Jens Lindström wrote: > https://codereview.chromium.org/353973002/diff/40001/Source/bindings/scripts/v8_attributes.py > File Source/bindings/scripts/v8_attributes.py (right): > > https://codereview.chromium.org/353973002/diff/40001/Source/bindings/scripts/v8_attributes.py#newcode313 ...
6 years, 5 months ago (2014-06-26 12:22:37 UTC) #4
Jens Widell
The CQ bit was checked by jl@opera.com
6 years, 5 months ago (2014-06-26 12:26:19 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jl@opera.com/353973002/40001
6 years, 5 months ago (2014-06-26 12:27:19 UTC) #6
commit-bot: I haz the power
6 years, 5 months ago (2014-06-26 15:14:53 UTC) #7
Message was sent while issue was closed.
Change committed as 176985

Powered by Google App Engine
This is Rietveld 408576698