Skip to content

Commit 1693576

Browse files
committed
Editorial: add a concept for Window's CustomElementRegistry
1 parent aa1c505 commit 1693576

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

source

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12041,8 +12041,8 @@ console.assert(el.constructor === Element);</code></pre>
1204112041
<span>overridden constructor steps</span>:</p>
1204212042

1204312043
<ol>
12044-
<li><p>Let <var>registry</var> be the <span>current global object</span>'s
12045-
<code>CustomElementRegistry</code> object.</p></li>
12044+
<li><p>Let <var>registry</var> be <span>current global object</span>'s <span
12045+
data-x="global-custom-element-registry">custom element registry</span>.</p></li>
1204612046

1204712047
<li>
1204812048
<p>If <span>NewTarget</span> is equal to the <span>active function
@@ -12065,23 +12065,25 @@ document.createElement("bad-1"); // (2)</code></pre>
1206512065
</li>
1206612066

1206712067
<li>
12068-
<p>Let <var>definition</var> be the entry in <var>registry</var> with <span
12068+
<p>Let <var>definition</var> be the item in <var>registry</var>'s <span>custom element
12069+
definition set</span> with <span
1206912070
data-x="concept-custom-element-definition-constructor">constructor</span> equal to
12070-
<span>NewTarget</span>. If there is no such definition, then throw a <code>TypeError</code>.</p>
12071+
<span>NewTarget</span>. If there is no such item, then throw a <code>TypeError</code>.</p>
1207112072

12072-
<p class="note">Since there can be no entry in <var>registry</var> with a <span
12073+
<p class="note">Since there can be no item in <var>registry</var>'s <span>custom element
12074+
definition set</span> with a <span
1207312075
data-x="concept-custom-element-definition-constructor">constructor</span> of undefined, this
1207412076
step also prevents HTML element constructors from being called as functions (since in that case
1207512077
<span>NewTarget</span> will be undefined).</p>
1207612078
</li>
1207712079

12078-
<li><p>Let <var>is value</var> be null.</p></li>
12080+
<li><p>Let <var>isValue</var> be null.</p></li>
1207912081

1208012082
<li>
1208112083
<p>If <var>definition</var>'s <span data-x="concept-custom-element-definition-local-name">local
1208212084
name</span> is equal to <var>definition</var>'s <span
1208312085
data-x="concept-custom-element-definition-name">name</span> (i.e., <var>definition</var> is for
12084-
an <span>autonomous custom element</span>), then:</p>
12086+
an <span>autonomous custom element</span>):</p>
1208512087

1208612088
<ol>
1208712089
<li>
@@ -12130,15 +12132,15 @@ document.createElement("bad-1"); // (2)</code></pre>
1213012132
</div>
1213112133
</li>
1213212134

12133-
<li><p>Set <var>is value</var> to <var>definition</var>'s <span
12135+
<li><p>Set <var>isValue</var> to <var>definition</var>'s <span
1213412136
data-x="concept-custom-element-definition-name">name</span>.</p></li>
1213512137
</ol>
1213612138
</li>
1213712139

1213812140
<li>
1213912141
<p>If <var>definition</var>'s <span
1214012142
data-x="concept-custom-element-definition-construction-stack">construction stack</span> is
12141-
empty, then:</p>
12143+
empty:</p>
1214212144

1214312145
<ol>
1214412146
<li><p>Let <var>element</var> be the result of <span data-x="internally create a new object
@@ -12167,7 +12169,7 @@ document.createElement("bad-1"); // (2)</code></pre>
1216712169
element definition</span> to <var>definition</var>.</p></li>
1216812170

1216912171
<li><p>Set <var>element</var>'s <span data-x="concept-element-is-value"><code
12170-
data-x="">is</code> value</span> to <var>is value</var>.</p></li>
12172+
data-x="">is</code> value</span> to <var>isValue</var>.</p></li>
1217112173

1217212174
<li><p>Return <var>element</var>.</p></li>
1217312175
</ol>
@@ -72625,7 +72627,7 @@ document.body.append(parent);
7262572627
null, then return null.</p></li>
7262672628

7262772629
<li><p>Let <var>registry</var> be <var>document</var>'s <span>relevant global object</span>'s
72628-
<code>CustomElementRegistry</code> object.</p></li>
72630+
<span data-x="global-custom-element-registry">custom element registry</span>.</p></li>
7262972631

7263072632
<li><p>If <var>registry</var>'s <span>custom element definition set</span> <span data-x="list
7263172633
contains">contains</span> an item with <span
@@ -72646,9 +72648,10 @@ document.body.append(parent);
7264672648

7264772649
<h4 id="custom-elements-api">The <code>CustomElementRegistry</code> interface</h4>
7264872650

72649-
<p w-nodev>Each <code>Window</code> object is associated with a unique instance of a
72650-
<code>CustomElementRegistry</code> object, allocated when the <code>Window</code> object is
72651-
created.</p>
72651+
<p w-nodev>Each <code>Window</code> object has an associated <dfn
72652+
data-x="global-custom-element-registry">custom element registry</dfn> (a
72653+
<code>CustomElementRegistry</code> object). It is set to a new
72654+
<code>CustomElementRegistry</code> object when the <code>Window</code> object is created.</p>
7265272655

7265372656
<p class="note">Custom element registries are associated with <code>Window</code> objects, instead
7265472657
of <code>Document</code> objects, since each <span>custom element constructor</span> inherits from

0 commit comments

Comments
 (0)