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.
Review URL: https://codereview.chromium.org/353973002
git-svn-id: svn://svn.chromium.org/blink/trunk@176985 bbb929c8-8fbe-4397-9dbb-9b2b20218538
5 files changed