diff options
Diffstat (limited to 'components/script/dom/cssstyledeclaration.rs')
-rw-r--r-- | components/script/dom/cssstyledeclaration.rs | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs index bbb788cceeb..d623f46005a 100644 --- a/components/script/dom/cssstyledeclaration.rs +++ b/components/script/dom/cssstyledeclaration.rs @@ -13,7 +13,7 @@ use crate::dom::bindings::root::{Dom, DomRoot}; use crate::dom::bindings::str::DOMString; use crate::dom::cssrule::CSSRule; use crate::dom::element::Element; -use crate::dom::node::{document_from_node, shadow_root_from_node, window_from_node, Node}; +use crate::dom::node::{document_from_node, stylesheets_owner_from_node, window_from_node, Node}; use crate::dom::window::Window; use dom_struct::dom_struct; use servo_arc::Arc; @@ -115,16 +115,8 @@ impl CSSStyleOwner { if changed { // If this is changed, see also // CSSStyleRule::SetSelectorText, which does the same thing. - if let Some(shadow_root) = - shadow_root_from_node(rule.parent_stylesheet().owner().upcast::<Node>()) - { - shadow_root.invalidate_stylesheets(); - } else { - rule.global() - .as_window() - .Document() - .invalidate_stylesheets(); - } + stylesheets_owner_from_node(rule.parent_stylesheet().owner().upcast::<Node>()) + .invalidate_stylesheets(); } result }, |