Flush shadow roots stylesheets only if they changed

This commit is contained in:
Fernando Jiménez Moreno 2019-02-21 12:34:59 +01:00
parent a841c713d6
commit 2674a3e717
4 changed files with 54 additions and 7 deletions

View file

@ -1352,13 +1352,11 @@ impl LayoutThread {
);
// Flush shadow roots stylesheets if dirty.
for shadow_root in document.shadow_roots() {
shadow_root.flush_stylesheets(
&self.stylist.device(),
document.quirks_mode(),
guards.author.clone(),
);
}
document.flush_shadow_roots_stylesheets(
&self.stylist.device(),
document.quirks_mode(),
guards.author.clone(),
);
let restyles = document.drain_pending_restyles();
debug!("Draining restyles: {}", restyles.len());