aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread/dom_wrapper.rs
diff options
context:
space:
mode:
authorFernando Jiménez Moreno <ferjmoreno@gmail.com>2019-02-13 17:01:30 +0100
committerFernando Jiménez Moreno <ferjmoreno@gmail.com>2019-04-26 10:17:47 +0200
commit519cc2c31754d75c1b6cab7db0cfb0c1aaabbdf7 (patch)
tree6c0c371647b8237f53378195d893236a27fc1856 /components/layout_thread/dom_wrapper.rs
parent18c1b8f6908e6f5eddce5413b37a83e34268d8e5 (diff)
downloadservo-519cc2c31754d75c1b6cab7db0cfb0c1aaabbdf7.tar.gz
servo-519cc2c31754d75c1b6cab7db0cfb0c1aaabbdf7.zip
Invalidate and flush shadow tree stylesheets where needed
Diffstat (limited to 'components/layout_thread/dom_wrapper.rs')
-rw-r--r--components/layout_thread/dom_wrapper.rs20
1 files changed, 18 insertions, 2 deletions
diff --git a/components/layout_thread/dom_wrapper.rs b/components/layout_thread/dom_wrapper.rs
index bbc023cf958..1aa9488c327 100644
--- a/components/layout_thread/dom_wrapper.rs
+++ b/components/layout_thread/dom_wrapper.rs
@@ -83,6 +83,7 @@ use style::dom::{DomChildren, LayoutIterator, NodeInfo, OpaqueNode};
use style::dom::{TDocument, TElement, TNode, TShadowRoot};
use style::element_state::*;
use style::font_metrics::ServoMetricsProvider;
+use style::media_queries::Device;
use style::properties::{ComputedValues, PropertyDeclarationBlock};
use style::selector_parser::{extended_filtering, PseudoElement, SelectorImpl};
use style::selector_parser::{AttrValue as SelectorAttrValue, Lang, NonTSPseudoClass};
@@ -219,11 +220,16 @@ impl<'sr> ServoShadowRoot<'sr> {
}
}
- pub fn flush_stylesheets(&self, guard: &SharedRwLockReadGuard) {
+ pub fn flush_stylesheets(
+ &self,
+ device: &Device,
+ quirks_mode: QuirksMode,
+ guard: &SharedRwLockReadGuard,
+ ) {
unsafe {
&self
.shadow_root
- .flush_stylesheets::<ServoLayoutElement>(guard)
+ .flush_stylesheets::<ServoLayoutElement>(device, quirks_mode, guard)
};
}
}
@@ -425,6 +431,16 @@ impl<'ld> ServoLayoutDocument<'ld> {
unsafe { self.document.style_shared_lock() }
}
+ pub fn shadow_roots(&self) -> Vec<ServoShadowRoot> {
+ unsafe {
+ self.document
+ .shadow_roots()
+ .iter()
+ .map(|sr| ServoShadowRoot::from_layout_js(*sr))
+ .collect()
+ }
+ }
+
pub fn from_layout_js(doc: LayoutDom<Document>) -> ServoLayoutDocument<'ld> {
ServoLayoutDocument {
document: doc,