Don't clear children of declarative shadow hosts when imperatively attaching another shadow root (#36104)

* Don't remove a declarative shadow hosts children when attaching an imperative shadow root

Instead we should remove all children of the shadowroot.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-03-23 14:49:45 +01:00 committed by GitHub
parent 3c51df0f1b
commit 3a356ffb74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1 additions and 107 deletions

View file

@ -562,8 +562,7 @@ impl Element {
}
// Step 4.3.1. Remove all of currentShadowRoots children, in tree order.
let node = self.upcast::<Node>();
for child in node.children() {
for child in current_shadow_root.upcast::<Node>().children() {
child.remove_self();
}