Skip to content

Commit

Permalink
Prevent attachInternals() use before custom element constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
mfreed7 authored Sep 28, 2020
1 parent f3dac08 commit 16667c3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion source
Original file line number Diff line number Diff line change
Expand Up @@ -66871,6 +66871,9 @@ customElements.define("x-foo", class extends HTMLElement {
does.</p>
</li>

<li><p>Set <var>element</var>'s <span>custom element state</span> to "<code
data-x="">precustomized</code>".</p></li>

<li>
<p>Let <var>constructResult</var> be the result of <span
data-x="es-constructing-callback-functions">constructing</span> <var>C</var>, with no
Expand Down Expand Up @@ -66930,7 +66933,8 @@ customElements.define("x-foo", class extends HTMLElement {
</ol>

<p class="note">If the above steps threw an exception, then <var>element</var>'s <span>custom
element state</span> will remain "<code data-x="">failed</code>".</p>
element state</span> will remain "<code data-x="">failed</code>" or "<code
data-x="">precustomized</code>".</p>
</li>

<li>
Expand Down Expand Up @@ -67435,6 +67439,10 @@ dictionary <dfn>ValidityStateFlags</dfn> {
<li><p>If <var>element</var>'s <span>attached internals</span> is true, then throw an
<span>"<code>NotSupportedError</code>"</span> <code>DOMException</code>.</p></li>

<li><p>If <var>element</var>'s <span>custom element state</span> is not "<code
data-x="">precustomized</code>" or "<code data-x="">custom</code>", then throw a
<span>"<code>NotSupportedError</code>"</span> <code>DOMException</code>.</p></li>

<li><p>Set <var>element</var>'s <span>attached internals</span> to true.</p></li>

<li><p>Create a new <code>ElementInternals</code> instance
Expand Down

0 comments on commit 16667c3

Please sign in to comment.