mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fix IS_IN_SHADOW_TREE flag for descendants after Node::remove call (#34803)
* Consider a UnbindContext to be tree-connected if its in a shadow root Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Properly track whether a node is in a shadow tree after removing subtree 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:
parent
e8f75c9aea
commit
1ab55e6b11
3 changed files with 34 additions and 15 deletions
|
@ -3665,7 +3665,11 @@ impl VirtualMethods for Element {
|
|||
}
|
||||
if let Some(ref value) = *self.id_attribute.borrow() {
|
||||
if let Some(ref shadow_root) = self.containing_shadow_root() {
|
||||
shadow_root.unregister_element_id(self, value.clone());
|
||||
// Only unregister the element id if the node was disconnected from it's shadow root
|
||||
// (as opposed to the whole shadow tree being disconnected as a whole)
|
||||
if !self.upcast::<Node>().is_in_shadow_tree() {
|
||||
shadow_root.unregister_element_id(self, value.clone());
|
||||
}
|
||||
} else {
|
||||
doc.unregister_element_id(self, value.clone());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue