mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Invalidate and flush shadow tree stylesheets where needed
This commit is contained in:
parent
18c1b8f690
commit
519cc2c317
8 changed files with 115 additions and 25 deletions
|
@ -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, window_from_node, Node};
|
||||
use crate::dom::node::{document_from_node, shadow_root_from_node, window_from_node, Node};
|
||||
use crate::dom::window::Window;
|
||||
use dom_struct::dom_struct;
|
||||
use servo_arc::Arc;
|
||||
|
@ -115,10 +115,16 @@ impl CSSStyleOwner {
|
|||
if changed {
|
||||
// If this is changed, see also
|
||||
// CSSStyleRule::SetSelectorText, which does the same thing.
|
||||
rule.global()
|
||||
.as_window()
|
||||
.Document()
|
||||
.invalidate_stylesheets();
|
||||
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();
|
||||
}
|
||||
}
|
||||
result
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue