DescriptionIDL: 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
Messages
Total messages: 7 (0 generated)
|