[webkit-dev] "ReflectOnly" IDL equivalent

Yoav Weiss yoav at yoav.ws
Fri Jun 9 21:56:15 PDT 2017


Apologies for not updating this thread sooner.
I already went ahead and implemented
<https://bugs.webkit.org/show_bug.cgi?id=173047> `as()` to reflect what's
needed, and was planning to refactor that and add a "ReflectEnum" binding
at a later patch.
If that's not needed, I can just leave it as is.

On Fri, Jun 9, 2017 at 8:47 PM Sam Weinig <weinig at apple.com> wrote:

>
>
> > On Jun 2, 2017, at 11:32 AM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> >
> > On Fri, Jun 2, 2017 at 9:18 AM, Chris Dumez <cdumez at apple.com> wrote:
> >> Hi,
> >>
> >> 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.
> >
> > I'd suggest other names like "ReflectEnum" or even "Reflect<EnumType>"
> > where EnumType is the name of enum that defines the list of values.
> >
> > "ReflectOnly" doesn't tell us on what "only" applies. If I didn't know
> > the context, it sounds like something that does less work than regular
> > "Reflect”.
>
>
> I don’t see a good reason to complicate the bindings until this becomes
> more common place.  For now, I would just implement HTMLLinkElement::as()
> to behave as you want and leave the IDL unannotated, and we can revisit it
> at a later time.
>
> - Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20170610/6745d0dc/attachment.html>


More information about the webkit-dev mailing list