diff options
Diffstat (limited to 'components/script/dom/htmlbaseelement.rs')
-rw-r--r-- | components/script/dom/htmlbaseelement.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/components/script/dom/htmlbaseelement.rs b/components/script/dom/htmlbaseelement.rs index 6823925cb37..71aa235df62 100644 --- a/components/script/dom/htmlbaseelement.rs +++ b/components/script/dom/htmlbaseelement.rs @@ -11,7 +11,7 @@ use crate::dom::bindings::str::DOMString; use crate::dom::document::Document; use crate::dom::element::{AttributeMutation, Element}; use crate::dom::htmlelement::HTMLElement; -use crate::dom::node::{document_from_node, Node, UnbindContext}; +use crate::dom::node::{document_from_node, BindContext, Node, UnbindContext}; use crate::dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; use html5ever::{LocalName, Prefix}; @@ -64,7 +64,7 @@ impl HTMLBaseElement { /// Update the cached base element in response to binding or unbinding from /// a tree. pub fn bind_unbind(&self, tree_in_doc: bool) { - if !tree_in_doc { + if !tree_in_doc || self.upcast::<Node>().containing_shadow_root().is_some() { return; } @@ -119,9 +119,9 @@ impl VirtualMethods for HTMLBaseElement { } } - fn bind_to_tree(&self, tree_in_doc: bool) { - self.super_type().unwrap().bind_to_tree(tree_in_doc); - self.bind_unbind(tree_in_doc); + fn bind_to_tree(&self, context: &BindContext) { + self.super_type().unwrap().bind_to_tree(context); + self.bind_unbind(context.tree_in_doc); } fn unbind_from_tree(&self, context: &UnbindContext) { |