Skip to content

Commit

Permalink
Modify the logic for double-declarative shadow root attachment
Browse files Browse the repository at this point in the history
Per the discussion at whatwg/dom#1235, this PR makes the *first* declarative shadow root "win". Prior behavior was for the *last* one to remain, but this PR changes second and subsequent declarative shadow roots to report an exception instead.
  • Loading branch information
mfreed7 authored Feb 15, 2024
1 parent 531e50d commit 39ec692
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -126151,26 +126151,20 @@ document.body.appendChild(text);
data-x="attr-template-shadowrootdelegatesfocus">shadowrootdelegatesfocus</code> attribute;
otherwise false.</p></li>

<li><p><span data-x="concept-attach-a-shadow-root">Attach a shadow root</span> with
<var>declarative shadow host element</var>, <var>mode</var>, <var>clonable</var>,
<var>delegatesFocus</var>, and "<code data-x="">named</code>".</p></li>
<li><p>If <var>declarative shadow host element</var> is a <span>shadow host</span>, then
<span>insert an element at the adjusted insertion location</span> with
<var>template</var>.</p></li>

<li>
<p>If an exception was thrown by <span data-x="concept-attach-a-shadow-root">attach a
shadow root</span>, then catch it, and run these steps:</p>
<p>Otherwise:

<ol>
<li><p><span>Report the exception</span>.</p></li>
<li><p><span data-x="concept-attach-a-shadow-root">Attach a shadow root</span> with
<var>declarative shadow host element</var>, <var>mode</var>, <var>clonable</var>,
<var>delegatesFocus</var>, and "<code data-x="">named</code>". If an exception is thrown,
then catch it, <span>report the exception</span>, <span>insert an element at the adjusted
insertion location</span> with <var>template</var>, and return.</p></li>

<li><p><span>Insert an element at the adjusted insertion location</span> with
<var>template</var>.</p></li>
</ol>
</li>

<li>
<p>Otherwise:</p>

<ol>
<li><p>Let <var>shadow</var> be <var>declarative shadow host element</var>'s
<span data-x="concept-element-shadow-root">shadow root</span>.</p></li>

Expand Down

0 comments on commit 39ec692

Please sign in to comment.