[webkit-dev] "ReflectOnly" IDL equivalent
cdumez at apple.com
Fri Jun 2 09:18:33 PDT 2017
No, I do not believe WebKit supports ReflectOnly and this is not standard IDL either.
The way to do it in WebKit would be to use a regular DOMString attribute, as in the specification and implement this logic in the c++ getter for this attribute. See HTMLElement::dir() for an example.
We could also consider adding support for something like ReflectOnly in our bindings generator considering that this seems to be used quite a bit in the HTML specification and it would decrease code complexity a little.
I’d actually be in favor of that.
> On Jun 1, 2017, at 10:57 PM, Yoav Weiss <yoav at yoav.ws> wrote:
> I'm working on the link preload feature and as part of that want to align it to the spec from an IDL perspective.
> The `as` attribute is defined <https://html.spec.whatwg.org/#attr-link-as> as an "enumerated attribute", which reflects only a finite set of known values. That is important for feature detection purposes, so that developers can know which `as` values are supported by the implementation.
> In Blink this is done using `ReflectOnly <https://chromium.googlesource.com/chromium/src/+/master/third_party/WebKit/Source/bindings/IDLExtendedAttributes.md#ReflectOnly_list_a>` (pending CL <https://codereview.chromium.org/2903653005/>), and I'm wondering what is the WebKit equivalent to implement attributes that are limited to known values <https://html.spec.whatwg.org/#limited-to-only-known-values>.
> Thanks! :)
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev