aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread/lib.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/lib.rs
parent18c1b8f6908e6f5eddce5413b37a83e34268d8e5 (diff)
downloadservo-519cc2c31754d75c1b6cab7db0cfb0c1aaabbdf7.tar.gz
servo-519cc2c31754d75c1b6cab7db0cfb0c1aaabbdf7.zip
Invalidate and flush shadow tree stylesheets where needed
Diffstat (limited to 'components/layout_thread/lib.rs')
-rw-r--r--components/layout_thread/lib.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs
index 839fac79006..8c46fb90720 100644
--- a/components/layout_thread/lib.rs
+++ b/components/layout_thread/lib.rs
@@ -103,7 +103,7 @@ use std::time::Duration;
use style::animation::Animation;
use style::context::{QuirksMode, RegisteredSpeculativePainter, RegisteredSpeculativePainters};
use style::context::{SharedStyleContext, ThreadLocalStyleContextCreationInfo};
-use style::dom::{ShowSubtree, ShowSubtreeDataAndPrimaryValues, TElement, TNode};
+use style::dom::{ShowSubtree, ShowSubtreeDataAndPrimaryValues, TDocument, TElement, TNode};
use style::driver;
use style::error_reporting::RustLogReporter;
use style::global_style_data::{GLOBAL_STYLE_DATA, STYLE_THREAD_POOL};
@@ -1346,6 +1346,17 @@ impl LayoutThread {
}
}
+ debug!(
+ "Shadow roots in document {:?}",
+ document.shadow_roots().len()
+ );
+
+ let device = Device::new(MediaType::screen(), initial_viewport, device_pixel_ratio);
+ // Flush shadow roots stylesheets if dirty.
+ for shadow_root in document.shadow_roots() {
+ shadow_root.flush_stylesheets(&device, document.quirks_mode(), guards.author.clone());
+ }
+
let restyles = document.drain_pending_restyles();
debug!("Draining restyles: {}", restyles.len());