W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2014

Adding [Reflect] to WebIDL?

From: Domenic Denicola <domenic@domenicdenicola.com>
Date: Thu, 7 Aug 2014 18:45:50 +0000
To: "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <1407437152635.19375@domenicdenicola.com>
(Original discussion in [1], especially [2])

>From my understanding, most (all?) browser engines commit IDL files for HTML elements that have a nonstandard [Reflect] attribute. For example, [3] is Blink's for HTMLParagraphElement:

    interface HTMLParagraphElement : HTMLElement {
        [Reflect] attribute DOMString align;

This is derived from the official spec IDL [4] [5], plus a paragraph of prose at [6]:

> The align IDL attribute of the p element must reflect the content attribute of the same name.

In [2], Anne brought up that it would be nice to standardize [Reflect] in WebIDL. I agree, except that it is weird for WebIDL to define something that only applies to HTML element interfaces. Anne suggested making IDL extensible, e.g. each spec could define relevant IDL modifiers like [Reflect] that are useful for that spec. That does sound ideal, but perhaps tricky to do right.

In the near-term, what does public-script-coord think?

- This is a bad idea; don't do it.
- Leave this alone until someone has time to really devote to WebIDL and doing it "right".
- Add [Reflect] to WebIDL, despite the layering violation.
- Add a definition for [Reflect] to HTML, and use it in HTML.

[1]: https://github.com/dglazkov/html-as-custom-elements/issues/32
[2]: https://github.com/dglazkov/html-as-custom-elements/issues/32#issuecomment-51444920
[3]: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/html/HTMLParagraphElement.idl&q=htmlparagraphelement&sq=package:chromium&type=cs&l=20
[4]: http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#htmlparagraphelement
[5]: http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLParagraphElement-partial
[6]: http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#dom-p-align
Received on Thursday, 7 August 2014 18:46:20 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:22 UTC