Skip to content

Commit 1ff2c33

Browse files
committed
Scope non-scoped (global) registries to a single document
Let the global custom element registry not escape its document for now. We throw an exception to give us some wiggle room in the future. DOM issue and PR: whatwg/dom#1390 & whatwg/dom#1392. Tests: TODO.
1 parent 10e9baa commit 1ff2c33

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

source

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73638,7 +73638,12 @@ dictionary <dfn dictionary>ElementDefinitionOptions</dfn> {
7363873638

7363973639
<dt><code data-x=""><var>registry</var>.<span subdfn data-x="dom-CustomElementRegistry-initialize">initialize</span>(<var>root</var>)</code></dt>
7364073640
<dd>Each <span>inclusive descendant</span> of <var>root</var> with a null registry will have it
73641-
updated to this <code>CustomElementRegistry</code> object.</dd>
73641+
updated to this <code>CustomElementRegistry</code> object. A
73642+
<span>"<code>NotSupportedError</code>"</span> <code>DOMException</code> will be thrown if this
73643+
<code>CustomElementRegistry</code> object is not for scoped usage and <var>root</var> is either a
73644+
<code>Document</code> node or <var>root</var>'s <span>node document</span>'s <span
73645+
data-x="document-custom-element-registry">custom element registry</span> is not this
73646+
<code>CustomElementRegistry</code> object.</dd>
7364273647
</dl>
7364373648

7364473649
<p w-nodev>The <dfn
@@ -73987,6 +73992,12 @@ console.assert(el instanceof SpiderMan); // upgraded!</code></pre>
7398773992
steps are:</p>
7398873993

7398973994
<ol>
73995+
<li><p>If <span>this</span>'s <span>is scoped</span> is false and <var>root</var> is either a
73996+
<code>Document</code> node or <var>root</var>'s <span>node document</span>'s <span
73997+
data-x="document-custom-element-registry">custom element registry</span> is not
73998+
<span>this</span>, then throw a <span>"<code>NotSupportedError</code>"</span>
73999+
<code>DOMException</code>.</p></li>
74000+
7399074001
<li><p>If <var>root</var> is a <code>Document</code> node whose <span
7399174002
data-x="document-custom-element-registry">custom element registry</span> is null, then set
7399274003
<var>root</var>'s <span data-x="document-custom-element-registry">custom element registry</span>

0 commit comments

Comments
 (0)