mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01: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
|
@ -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());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue