-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update all constructors, including [HTMLConstructor] #4915
Conversation
This updates all the constructors in the standard for recent changes to Web IDL. In particular: * Replace [Constructor] extended attributes with constructor operations * Cross-links constructor operations on events to the DOM event constructor definition * Changes [HTMLConstructor] to apply to constructor operations, instead of to interfaces, and updates all usages of it * Changes the definition of [HTMLConstructor] to leverage new Web IDL concepts of "usual constructor steps" and "internally create a new object implementing the interface" Fixes #4870. Fixes #4890.
This is for use in [HTMLConstructor] in whatwg/html#4915.
Direct link to preview of the new [HTMLConstructor] definition: https://whatpr.org/html/4915/dom.html#html-element-constructors |
corresponding JavaScript function object. When invoked with [[Call]], the NewTarget value is | ||
undefined, and so the algorithm below will immediately throw. When invoked with [[Construct]], the | ||
[[Construct]] <var>newTarget</var> parameter provides the NewTarget value.</p> | ||
<p><span data-x="interface object">Interface objects</span> declared with constructor operations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interface objects aren't declared with a constructor operations; interfaces might be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "Interface objects for interfaces declared with ..."?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thank you! I agree that this does not change observable behavior, as far as I can tell.
corresponding JavaScript function object. When invoked with [[Call]], the NewTarget value is | ||
undefined, and so the algorithm below will immediately throw. When invoked with [[Construct]], the | ||
[[Construct]] <var>newTarget</var> parameter provides the NewTarget value.</p> | ||
<p><span data-x="interface object">Interface objects</span> declared with constructor operations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "Interface objects for interfaces declared with ..."?
data-x="concept-custom-element-definition-local-name">local name</span>, and <span>node | ||
document</span> set to the <span>current global object</span>'s <span | ||
data-x="concept-document-window">associated <code>Document</code></span>.</p></li> | ||
<li><p>Let <var>element</var> be the result of <span data-x="internally create a new object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to say something here about rethrowing exceptions? It's not clear to me when we do that explicitly and when it's sort of implied...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These days it's implied. (Unless we're explicitly in ?/! mode, which we're not here.)
This is for use in [HTMLConstructor] in whatwg/html#4915.
This updates all the constructors in the standard for recent changes to
Web IDL. In particular:
constructor definition
of to interfaces, and updates all usages of it
concepts of "usual constructor steps" and "internally create a new
object implementing the interface"
Fixes #4870. Fixes #4890.
Reviewers: feel free to skim the [Constructor] -> constructor() changes, but please do check the new definition of [HTMLConstructor]. The intention was not to introduce any normative changes, but in the course of making it more rigorous, something might have slipped in.
Marking "do not merge yet" as this has a dependency on Web IDL introducing the term "usual constructor steps" so that we can override them. I will work on that PR next.
/canvas.html ( diff )
/comms.html ( diff )
/dom.html ( diff )
/edits.html ( diff )
/embedded-content.html ( diff )
/form-elements.html ( diff )
/forms.html ( diff )
/grouping-content.html ( diff )
/iframe-embed-object.html ( diff )
/image-maps.html ( diff )
/infrastructure.html ( diff )
/input.html ( diff )
/interactive-elements.html ( diff )
/media.html ( diff )
/obsolete.html ( diff )
/scripting.html ( diff )
/sections.html ( diff )
/semantics.html ( diff )
/server-sent-events.html ( diff )
/tables.html ( diff )
/text-level-semantics.html ( diff )
/web-messaging.html ( diff )
/web-sockets.html ( diff )
/webappapis.html ( diff )
/workers.html ( diff )