Skip to content

Commit 7da45df

Browse files
authored
Adjust shadowrootcustomelementregistry attribute serialization
whatwg/dom#1409 changed where attachShadow() obtains its registry so the serialization should account for that as well. Tests: web-platform-tests/wpt#56134. Fixes #11892.
1 parent b973c6a commit 7da45df

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

source

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3412,6 +3412,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
34123412
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-element-attributes-get-by-name">get an attribute by name</dfn> algorithm</li>
34133413
<li><dfn data-x-href="https://dom.spec.whatwg.org/#valid-attribute-local-name">valid attribute local name</dfn></li>
34143414
<li><dfn data-x-href="https://dom.spec.whatwg.org/#valid-element-local-name">valid element local name</dfn></li>
3415+
<li><dfn data-x-href="https://dom.spec.whatwg.org/#is-a-global-custom-element-registry">is a global custom element registry</dfn></li>
34153416
</ul>
34163417

34173418
<p>The following features are defined in <cite>UI Events</cite>: <ref>UIEVENTS</ref></p>
@@ -144140,10 +144141,29 @@ document.body.appendChild(text);
144140144141
<li><p>If <var>shadow</var>'s <span>clonable</span> is set, then append
144141144142
"<code data-x=""> shadowrootclonable=&quot;&quot;</code>".</p></li>
144142144143

144143-
<li><p>If <var>current node</var>'s <span data-x="element-custom-element-registry">custom
144144-
element registry</span> is not <var>shadow</var>'s <span
144145-
data-x="shadow-root-custom-element-registry">custom element registry</span>, then append
144146-
"<code data-x=""> shadowrootcustomelementregistry=&quot;&quot;</code>".</p></li>
144144+
<li>
144145+
<p>Let <var>shouldAppendRegistryAttribute</var> be the result of running these steps:</p>
144146+
144147+
<ol>
144148+
<li><p>Let <var>documentRegistry</var> be <var>shadow</var>'s <span>node document</span>'s
144149+
<span data-x="document-custom-element-registry">custom element registry</span>.</p></li>
144150+
144151+
<li><p>Let <var>shadowRegistry</var> be <var>shadow</var>'s <span
144152+
data-x="shadow-root-custom-element-registry">custom element registry</span>.</p></li>
144153+
144154+
<li><p>If <var>documentRegistry</var> is null and <var>shadowRegistry</var> is null, then
144155+
return false.</p></li>
144156+
144157+
<li><p>If <var>documentRegistry</var> <span>is a global custom element registry</span> and
144158+
<var>shadowRegistry</var> <span>is a global custom element registry</span>, then return
144159+
false.</p></li>
144160+
144161+
<li><p>Return true.</p></li>
144162+
</ol>
144163+
</li>
144164+
144165+
<li><p>If <var>shouldAppendRegistryAttribute</var> is true, then append "<code
144166+
data-x=""> shadowrootcustomelementregistry=&quot;&quot;</code>".</p></li>
144147144167

144148144168
<li><p>Append "<code data-x="">&gt;</code>".</p></li>
144149144169

0 commit comments

Comments
 (0)