Skip to content

Commit 0cb27c8

Browse files
authored
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: web-platform-tests/wpt#53791.
1 parent 49f5cd3 commit 0cb27c8

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
@@ -74233,7 +74233,12 @@ dictionary <dfn dictionary>ElementDefinitionOptions</dfn> {
7423374233

7423474234
<dt><code data-x=""><var>registry</var>.<span subdfn data-x="dom-CustomElementRegistry-initialize">initialize</span>(<var>root</var>)</code></dt>
7423574235
<dd>Each <span>inclusive descendant</span> of <var>root</var> with a null registry will have it
74236-
updated to this <code>CustomElementRegistry</code> object.</dd>
74236+
updated to this <code>CustomElementRegistry</code> object. A
74237+
<span>"<code>NotSupportedError</code>"</span> <code>DOMException</code> will be thrown if this
74238+
<code>CustomElementRegistry</code> object is not for scoped usage and <var>root</var> is either a
74239+
<code>Document</code> node or <var>root</var>'s <span>node document</span>'s <span
74240+
data-x="document-custom-element-registry">custom element registry</span> is not this
74241+
<code>CustomElementRegistry</code> object.</dd>
7423774242
</dl>
7423874243

7423974244
<p w-nodev>The <dfn
@@ -74582,6 +74587,12 @@ console.assert(el instanceof SpiderMan); // upgraded!</code></pre>
7458274587
steps are:</p>
7458374588

7458474589
<ol>
74590+
<li><p>If <span>this</span>'s <span>is scoped</span> is false and <var>root</var> is either a
74591+
<code>Document</code> node or <var>root</var>'s <span>node document</span>'s <span
74592+
data-x="document-custom-element-registry">custom element registry</span> is not
74593+
<span>this</span>, then throw a <span>"<code>NotSupportedError</code>"</span>
74594+
<code>DOMException</code>.</p></li>
74595+
7458574596
<li><p>If <var>root</var> is a <code>Document</code> node whose <span
7458674597
data-x="document-custom-element-registry">custom element registry</span> is null, then set
7458774598
<var>root</var>'s <span data-x="document-custom-element-registry">custom element registry</span>

0 commit comments

Comments
 (0)