@@ -66355,12 +66355,9 @@ dictionary <dfn>ElementDefinitionOptions</dfn> {
66355
66355
data-x="concept-custom-element-definition-local-name">local name</span>, or <span
66356
66356
data-x="concept-custom-element-definition-constructor">constructor</span>.</p>
66357
66357
66358
- <p>Every <code>CustomElementsRegistry</code> also has a <dfn>set of being-defined names</dfn> and
66359
- a <dfn>set of being-defined constructors</dfn>, containing <span data-x="valid custom element
66360
- name">valid custom element names</span> and JavaScript function objects, respectively. These are
66361
- used to ensure that when script executes during <span>element definition</span>, which can
66362
- reentrantly cause <span>element definition</span> again, the script cannot define another element
66363
- using the same name or constructor.</p>
66358
+ <p>Every <code>CustomElementsRegistry</code> also has an <dfn>element definition is running</dfn>
66359
+ flag which is used to prevent reentrant invocations of <span>element definition</span>. It is
66360
+ initially unset.</p>
66364
66361
66365
66362
<p>Every <code>CustomElementsRegistry</code> also has a <dfn>when-defined promise map</dfn>,
66366
66363
mapping <span data-x="valid custom element name">valid custom element names</span> to promises. It
@@ -66448,20 +66445,11 @@ dictionary <dfn>ElementDefinitionOptions</dfn> {
66448
66445
<span>"<code>NotSupportedError</code>"</span> <code>DOMException</code> and abort these
66449
66446
steps.</p></li>
66450
66447
66451
- <li><p>If this <code>CustomElementsRegistry</code>'s <span>set of being-defined names</span>
66452
- contains <var>name</var>, then throw a <span>"<code>NotSupportedError</code>"</span>
66453
- <code>DOMException</code> and abort these steps.</p></li>
66454
-
66455
66448
<li><p>If this <code>CustomElementsRegistry</code> contains an entry with <span
66456
66449
data-x="concept-custom-element-definition-constructor">constructor</span> <var>constructor</var>,
66457
66450
then throw a <span>"<code>NotSupportedError</code>"</span> <code>DOMException</code> and abort
66458
66451
these steps.</p></li>
66459
66452
66460
- <li><p>If this <code>CustomElementsRegistry</code>'s <span>set of being-defined
66461
- constructors</span> contains <var>constructor</var>, then throw a
66462
- <span>"<code>NotSupportedError</code>"</span> <code>DOMException</code> and abort these
66463
- steps.</p></li>
66464
-
66465
66453
<li><p>Let <var>localName</var> be <var>name</var>.</p></li>
66466
66454
66467
66455
<li><p>Let <var>extends</var> be the value of the <code data-x="">extends</code> member of
@@ -66483,11 +66471,12 @@ dictionary <dfn>ElementDefinitionOptions</dfn> {
66483
66471
</ol>
66484
66472
</li>
66485
66473
66486
- <li><p>Add <var>name</var> to this <code>CustomElementsRegistry</code>'s <span>set of
66487
- being-defined names</span>.</p></li>
66474
+ <li><p>If this <code>CustomElementsRegistry</code>'s <span>element definition is running</span>
66475
+ flag is set, then throw a <span>"<code>NotSupportedError</code>"</span> <code>DOMException</code>
66476
+ and abort these steps.</p></li>
66488
66477
66489
- <li><p>Add <var>constructor</var> to this <code>CustomElementsRegistry</code>'s <span>set of
66490
- being-defined constructors</span> .</p></li>
66478
+ <li><p>Set this <code>CustomElementsRegistry</code>'s <span>element definition is running</span>
66479
+ flag .</p></li>
66491
66480
66492
66481
<li>
66493
66482
<p>Run the following substeps while catching any exceptions:</p>
@@ -66540,18 +66529,15 @@ dictionary <dfn>ElementDefinitionOptions</dfn> {
66540
66529
</ol>
66541
66530
</ol>
66542
66531
66543
- <p>Then, perform the following substeps , regardless of whether the above steps threw an
66544
- exception or not:</p>
66532
+ <p>Then, perform the following substep , regardless of whether the above steps threw an exception
66533
+ or not:</p>
66545
66534
66546
66535
<ol>
66547
- <li><p>Remove <var>name</var> from this <code>CustomElementsRegistry</code>'s <span>set of
66548
- being-defined names</span>.</p></li>
66549
-
66550
- <li><p>Remove <var>constructor</var> from this <code>CustomElementsRegistry</code>'s <span>set
66551
- of being-defined constructors</span>.</p></li>
66536
+ <li><p>Unset this <code>CustomElementsRegistry</code>'s <span>element definition is
66537
+ running</span> flag.</p></li>
66552
66538
</ol>
66553
66539
66554
- <p>Finally, if the first set of steps threw an exception, then rethrow that exception, and
66540
+ <p>Finally, if the first set of substeps threw an exception, then rethrow that exception, and
66555
66541
terminate this algorithm. Otherwise, continue onward.</p>
66556
66542
</li>
66557
66543
0 commit comments