Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6954,8 +6954,30 @@ null, or a {{CustomElementRegistry}} object <var>registry</var> (default "<code>
<li><p>Set <var>result</var> to the result of <a>constructing</a> <var>C</var>, with no
arguments.

<li><p>Assert: <var>result</var>'s <a for=Element>custom element state</a> and
<a for=Element>custom element definition</a> are initialized.
<li>
<p><a for=/>Assert</a>: <var>result</var>'s <a for=Element>custom element state</a> is
"<code>custom</code>" and its <a for=Element>custom element definition</a> is non-null,
<var>result</var>'s <a for=Element>custom element state</a> is "<code>precustomized</code>",
or <var>result</var>'s <a for=Element>custom element state</a> is neither
"<code>custom</code>" nor "<code>precustomized</code>" and its
<a for=Element>custom element definition</a> is null.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


<div class=example id=example-return-override>
<pre><code class=lang-javascript>
customElements.define("x-example", class extends HTMLElement {
constructor() {
// Non-conformant: returns an existing element instead of calling super().
return document.createElement("p");
}
});

document.createElement("x-example");
</code></pre>

<p>Here <var>result</var> is the <code>p</code> <a for=/>element</a>, whose
<a for=Element>custom element state</a> is "<code>uncustomized</code>" and whose
<a for=Element>custom element definition</a> is null.
</div>

<li>
<p>Assert: <var>result</var>'s <a for=Element>namespace</a> is the <a>HTML namespace</a>.
Expand Down