Skip to content

Commit 5f9f41b

Browse files
committed
Fix upgrade particular elements within a document again
When a CustomElementRegistry define() call starts upgrading elements, we need to make sure to only include those associated with the current registry. This has test coverage through WPT custom-elements/registries/CustomElementRegistry-upgrade.html. Fixes #11256.
1 parent 1e52d1d commit 5f9f41b

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

source

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74003,11 +74003,11 @@ dictionary <dfn dictionary>ElementDefinitionOptions</dfn> {
7400374003

7400474004
<li><p>If <span>this</span>'s <span>is scoped</span> is true, then for each <var>document</var>
7400574005
of <span>this</span>'s <span>scoped document set</span>: <span>upgrade particular elements within
74006-
a document</span> given <var>document</var>, <var>definition</var>, and
74006+
a document</span> given <span>this</span>, <var>document</var>, <var>definition</var>, and
7400774007
<var>localName</var>.</p></li>
7400874008

7400974009
<li><p>Otherwise, <span>upgrade particular elements within a document</span> given
74010-
<span>this</span>'s <span>relevant global object</span>'s <span
74010+
<span>this</span>, <span>this</span>'s <span>relevant global object</span>'s <span
7401174011
data-x="concept-document-window">associated <code>Document</code></span>, <var>definition</var>,
7401274012
<var>localName</var>, and <var>name</var>.</p></li>
7401374013

@@ -74025,16 +74025,17 @@ dictionary <dfn dictionary>ElementDefinitionOptions</dfn> {
7402574025
</li>
7402674026
</ol>
7402774027

74028-
<p>To <dfn>upgrade particular elements within a document</dfn> given a <code>Document</code>
74029-
object <var>document</var>, a <span>custom element definition</span> <var>definition</var>, a
74030-
string <var>localName</var>, and optionally a string <var>name</var> (default
74031-
<var>localName</var>):</p>
74028+
<p>To <dfn>upgrade particular elements within a document</dfn> given a
74029+
<code>CustomElementRegistry</code> object <var>registry</var>, a <code>Document</code> object
74030+
<var>document</var>, a <span>custom element definition</span> <var>definition</var>, a string
74031+
<var>localName</var>, and optionally a string <var>name</var> (default <var>localName</var>):</p>
7403274032

7403374033
<ol>
7403474034
<li><p>Let <var>upgradeCandidates</var> be all elements that are <span data-x="shadow-including
74035-
descendant">shadow-including descendants</span> of <var>document</var>, whose namespace
74036-
is the <span>HTML namespace</span> and whose local name is <var>localName</var>, in
74037-
<span>shadow-including tree order</span>. Additionally, if <var>name</var> is not
74035+
descendant">shadow-including descendants</span> of <var>document</var>, whose <span
74036+
data-x="element-custom-element-registry">custom element registry</span> is <var>registry</var>,
74037+
whose namespace is the <span>HTML namespace</span>, and whose local name is <var>localName</var>,
74038+
in <span>shadow-including tree order</span>. Additionally, if <var>name</var> is not
7403874039
<var>localName</var>, only include elements whose <span data-x="concept-element-is-value"><code
7403974040
data-x="">is</code> value</span> is equal to <var>name</var>.</p></li>
7404074041

0 commit comments

Comments
 (0)