aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/element.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r--components/script/dom/element.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index be31e9ba122..daae203bd52 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -544,7 +544,8 @@ impl Element {
let bind_context = BindContext {
tree_connected: self.upcast::<Node>().is_connected(),
- tree_in_doc: self.upcast::<Node>().is_in_doc(),
+ tree_is_in_a_document_tree: self.upcast::<Node>().is_in_a_document_tree(),
+ tree_is_in_a_shadow_tree: true,
};
shadow_root.bind_to_tree(&bind_context);
@@ -1355,7 +1356,7 @@ impl Element {
}
pub fn root_element(&self) -> DomRoot<Element> {
- if self.node.is_in_doc() {
+ if self.node.is_in_a_document_tree() {
self.upcast::<Node>()
.owner_doc()
.GetDocumentElement()
@@ -3512,7 +3513,7 @@ impl VirtualMethods for Element {
});
let containing_shadow_root = self.containing_shadow_root();
- if node.is_connected_to_tree() {
+ if node.is_in_a_document_tree() || node.is_in_a_shadow_tree() {
let value = attr.value().as_atom().clone();
match mutation {
AttributeMutation::Set(old_value) => {
@@ -3619,7 +3620,7 @@ impl VirtualMethods for Element {
shadow_root.bind_to_tree(context);
}
- if !context.tree_connected {
+ if !context.is_in_tree() {
return;
}
@@ -3652,7 +3653,7 @@ impl VirtualMethods for Element {
f.unbind_form_control_from_tree();
}
- if !context.tree_connected {
+ if !context.tree_is_in_a_document_tree && !context.tree_is_in_a_shadow_tree {
return;
}
@@ -3668,7 +3669,7 @@ impl VirtualMethods for Element {
if let Some(ref shadow_root) = self.containing_shadow_root() {
// 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() {
+ if !self.upcast::<Node>().is_in_a_shadow_tree() {
shadow_root.unregister_element_id(self, value.clone());
}
} else {