mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Bind/unbind shadow host children to/from tree
This commit is contained in:
parent
df81debffc
commit
1b036355ce
2 changed files with 29 additions and 2 deletions
|
@ -2784,6 +2784,16 @@ impl VirtualMethods for Element {
|
|||
return;
|
||||
}
|
||||
|
||||
if self.is_shadow_host() {
|
||||
let shadow_root = self.shadow_root.get().unwrap();
|
||||
let shadow_root = shadow_root.upcast::<Node>();
|
||||
shadow_root.set_flag(NodeFlags::IS_CONNECTED, tree_connected);
|
||||
for node in shadow_root.children() {
|
||||
node.set_flag(NodeFlags::IS_CONNECTED, tree_connected);
|
||||
node.bind_to_tree(tree_connected);
|
||||
}
|
||||
}
|
||||
|
||||
let doc = document_from_node(self);
|
||||
if let Some(ref value) = *self.id_attribute.borrow() {
|
||||
doc.register_named_element(self, value.clone());
|
||||
|
@ -2803,6 +2813,16 @@ impl VirtualMethods for Element {
|
|||
return;
|
||||
}
|
||||
|
||||
if self.is_shadow_host() {
|
||||
let shadow_root = self.shadow_root.get().unwrap();
|
||||
let shadow_root = shadow_root.upcast::<Node>();
|
||||
shadow_root.set_flag(NodeFlags::IS_CONNECTED, false);
|
||||
for node in shadow_root.children() {
|
||||
node.set_flag(NodeFlags::IS_CONNECTED, false);
|
||||
node.unbind_from_tree(context);
|
||||
}
|
||||
}
|
||||
|
||||
let doc = document_from_node(self);
|
||||
let fullscreen = doc.GetFullscreenElement();
|
||||
if fullscreen.deref() == Some(self) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue