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
mfreed7 committed Jan 14, 2024
1 parent da484da commit d94ce87
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6965,8 +6965,17 @@ 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 d94ce87

Please sign in to comment.