julien.chaffraix at gmail.com
Tue Oct 18 08:48:12 PDT 2011
> I'v noticed that in the interface descriptions of html objects, not
> every field is marked with a Reflect. For example,
> WebCore/html/HTMLImageElement.idl does not mark the width and height
> attributes as Reflect. However, name, hspace and vspace are marked
> I'm just wondering, why the inconsistency? why not just Reflect on
> every attribute?
It's not necessarily an inconsistency. The definition of reflection is
given in HTML5 . We try to follow the standards on what should and
should not be reflected but it is in flux so there may be differences.
Now from WebKit perspective, using [reflect] for an IDL property means
that the binding script will auto-generate the logic to return the
associated attribute value. When this is undesirable (for example you
have some processing to do), [reflect] may not be the best solution.
In the example you give, width and height values depends on different
factors (see the implementation of width ). Also we need to resolve
any pending stylesheet to make sure the values are up-to-date when
queried. In those conditions, the simple reflected logic just does not
Hope it helps,
More information about the webkit-help