Skip to content

Commit

Permalink
Use Web IDL to construct custom element constructors
Browse files Browse the repository at this point in the history
This fixes part of #2381 (the other part is in DOM's "create an
element").
  • Loading branch information
domenic committed Mar 23, 2017
1 parent 362c931 commit 7e0bb3f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -2778,7 +2778,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<dfn data-x-href="https://heycam.github.io/webidl/#dfn-create-frozen-array">creating a frozen array</dfn></li>
<li><dfn data-x="dfn-callback-this-value" data-x-href="https://heycam.github.io/webidl/#dfn-callback-this-value">callback this value</dfn></li>
<li><dfn data-x="concept-idl-convert" data-x-href="https://heycam.github.io/webidl/#es-type-mapping">converting</dfn> between Web IDL types and JS types</li>
<li><dfn data-x="es-invoking-callback-functions" data-x-href="https://heycam.github.io/webidl/#es-invoking-callback-functions">invoke the Web IDL callback function</dfn></li>
<li><dfn data-x="es-invoking-callback-functions" data-x-href="https://heycam.github.io/webidl/#invoke-a-callback-function">invoking</dfn> and
<dfn data-x="es-constructing-callback-functions" data-x-href="https://heycam.github.io/webidl/#construct-a-callback">constructing</dfn> callback functions</li>
<li><dfn data-x-href="https://heycam.github.io/webidl/#dfn-obtain-unicode">converting to a
sequence of Unicode scalar values</dfn></li>
</ul>
Expand Down Expand Up @@ -66451,7 +66452,9 @@ console.log(plasticButton2.getAttribute("is")); // will output "plastic-button"<

<p>Several of these requirements are checked during <span data-x="create an element">element
creation</span>, either directly or indirectly, and failing to follow them will result in a custom
element that cannot be instantiated by the parser or DOM APIs.</p>
element that cannot be instantiated by the parser or DOM APIs. This is true even if the work is
done inside a constructor-initiated <span>microtask</span>, as a <span data-x="perform a microtask
checkpoint">microtask checkpoint</span> can occur immediately after construction.</p>

<h4 id="custom-elements-core-concepts">Core concepts</h4>

Expand Down Expand Up @@ -66604,7 +66607,8 @@ console.log(plasticButton2.getAttribute("is")); // will output "plastic-button"<

<dt>A <dfn data-x="concept-custom-element-definition-constructor" data-export=""
data-dfn-for="custom element definition">constructor</dfn></dt>
<dd>A <span>custom element constructor</span></dd>
<dd>A Web IDL <code data-x="idl-Function">Function</code> callback function type value wrapping
the <span>custom element constructor</span></dd>

<dt>A list of <dfn data-x="concept-custom-element-definition-observed-attributes">observed
attributes</dfn></dt>
Expand Down Expand Up @@ -67020,7 +67024,9 @@ customElements.define("x-foo", class extends HTMLElement {

<ol>
<li>
<p>Let <var>constructResult</var> be <span>Construct</span>(<var>C</var>).</p>
<p>Let <var>constructResult</var> be the result of <span
data-x="es-constructing-callback-functions">constructing</span> <var>C</var> with no
arguments.</p>

<p class="note">If <var>C</var> <a href="#custom-element-conformance">non-conformantly</a>
uses an API decorated with the <code data-x="CEReactions">[CEReactions]</code> extended
Expand Down

0 comments on commit 7e0bb3f

Please sign in to comment.