diff options
Diffstat (limited to 'components/script/dom/cssstylesheet.rs')
-rw-r--r-- | components/script/dom/cssstylesheet.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/components/script/dom/cssstylesheet.rs b/components/script/dom/cssstylesheet.rs index 9863dede5cb..66d2fd8a339 100644 --- a/components/script/dom/cssstylesheet.rs +++ b/components/script/dom/cssstylesheet.rs @@ -4,7 +4,6 @@ use crate::dom::bindings::codegen::Bindings::CSSStyleSheetBinding; use crate::dom::bindings::codegen::Bindings::CSSStyleSheetBinding::CSSStyleSheetMethods; -use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowBinding::WindowMethods; use crate::dom::bindings::error::{Error, ErrorResult, Fallible}; use crate::dom::bindings::inheritance::Castable; use crate::dom::bindings::reflector::{reflect_dom_object, DomObject}; @@ -12,7 +11,7 @@ use crate::dom::bindings::root::{Dom, DomRoot, MutNullableDom}; use crate::dom::bindings::str::DOMString; use crate::dom::cssrulelist::{CSSRuleList, RulesSource}; use crate::dom::element::Element; -use crate::dom::node::{shadow_root_from_node, Node}; +use crate::dom::node::{stylesheets_owner_from_node, Node}; use crate::dom::stylesheet::StyleSheet; use crate::dom::window::Window; use dom_struct::dom_struct; @@ -87,14 +86,7 @@ impl CSSStyleSheet { pub fn set_disabled(&self, disabled: bool) { if self.style_stylesheet.set_disabled(disabled) { - if let Some(shadow_root) = shadow_root_from_node(self.owner.upcast::<Node>()) { - shadow_root.invalidate_stylesheets(); - } else { - self.global() - .as_window() - .Document() - .invalidate_stylesheets(); - } + stylesheets_owner_from_node(self.owner().upcast::<Node>()).invalidate_stylesheets(); } } |