Skip to content

Commit

Permalink
Reset declarative to false when calling attachShadow
Browse files Browse the repository at this point in the history
This was an oversight in the spec, and this matches browser
behavior. This makes a second call to `attachShadow()` throw.

Closes #1234
  • Loading branch information
Mason Freed committed Jan 9, 2024
1 parent da484da commit cb6388c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6965,8 +6965,16 @@ a boolean <var>delegatesFocus</var>, and a boolean <var>slotAssignment</var>:
is false, then <a>throw</a> an "{{NotSupportedError!!exception}}" {{DOMException}}.

<li>
<p>Otherwise, <a for=/>remove</a> all of <var>element</var>'s <a for=Element>shadow root</a>'s
<a for=tree>children</a>, in <a>tree order</a>, and return.
<p>Otherwise:

<ol>
<li><p><a for=/>Remove</a> all of <var>element</var>'s <a for=Element>shadow root</a>'s
<a for=tree>children</a>, in <a>tree order</a>.

<li><p>Set <var>element</var>'s <a for=Element>shadow root</a>'s <a for=ShadowRoot>declarative</a> to false.

<li><p>Return.
</ol>

<p class=note>This means that if multiple declarative shadow roots are contained within a single
shadow host, only the last one will remain.
Expand Down

0 comments on commit cb6388c

Please sign in to comment.