Add missing [HTMLConstructor] annotations#2032
Conversation
|
Should the note not also be added to https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors since a couple of element names can end up using the HTMLUnknownElement class? |
|
Hmm interesting. Probably not there, but maybe something in https://html.spec.whatwg.org/multipage/scripting.html#custom-elements-customized-builtin-example saying e.g.
|
|
I guess. We should also add to that note the reason that only existing HTML elements can be extended. The being forward compatible argument. |
|
Adding back the keyword for now since you asked a question at #2028 (comment) that seems unresolved. Looks good to me otherwise. |
|
I made applet/keygen uncustomizable, with an explanation; /cc @dominiccooney @smaug----. Seems like the way to go. |
| <pre class="idl">interface <dfn>HTMLKeygenElement</dfn> : <span>HTMLElement</span> { // Note: <a href="#customized-built-in-element-restrictions">intentionally</a> not [<span>HTMLConstructor</span>] | ||
| attribute boolean <span data-x="dom-fe-autofocus">autofocus</span>; | ||
| attribute DOMString <span data-x="dom-keygen-challenge">challenge</span>; | ||
| attribute boolean <span data-x="dom-fe-disabled">disabled</span>; |
There was a problem hiding this comment.
I think typically the IDL blocks are indented such that 'attribute' lines up with 'readonly attribute' (when there are no extended attributes), so 9 more spaces before 'attribute'. (Same for HTMLAppletElement.)
Otherwise LGTM
There was a problem hiding this comment.
We don't seem to do that anywhere else in the spec that I can find.
source
Outdated
| [<span>CEReactions</span>] attribute boolean <span data-x="dom-fe-autofocus">autofocus</span>; | ||
| [<span>CEReactions</span>] attribute DOMString <span data-x="dom-keygen-challenge">challenge</span>; | ||
| [<span>CEReactions</span>] attribute boolean <span data-x="dom-fe-disabled">disabled</span>; | ||
| <pre class="idl">interface <dfn>HTMLKeygenElement</dfn> : <span>HTMLElement</span> { // Note: <a href="#customized-built-in-element-restrictions">intentionally</a> not [<span>HTMLConstructor</span>] |
There was a problem hiding this comment.
I think it would be nice if the note was on its own line preceding the interface just as you did above.
source
Outdated
| [<span>CEReactions</span>] attribute USVString _<span data-x="dom-applet-object">object</span>; // the underscore is not part of the identifier <!-- it's a Web IDL escaping mechanism --> | ||
| [<span>CEReactions</span>] attribute unsigned long <span data-x="dom-applet-vspace">vspace</span>; | ||
| [<span>CEReactions</span>] attribute DOMString <span data-x="dom-applet-width">width</span>; | ||
| <pre class="idl">interface <dfn>HTMLAppletElement</dfn> : <span>HTMLElement</span> { // Note: <a href="#customized-built-in-element-restrictions">intentionally</a> not [<span>HTMLConstructor</span>] |
Fixes #2028. [HTMLConstructor] was introduced in #1404, and these
constructors were accidentally left out of the fun.
For tests, this is part of the larger testing program of customized built-in elements, which implementers are working on contributing to.