style: Look at the snapshots when invalidating due to stylesheet changes.

Otherwise removal of stylesheets may get out of sync with other DOM changes, and
we may fail to invalidate the style of the affected elements.

Bug: 1432850
Reviewed-by: bz
MozReview-Commit-ID: DrMTgLzQcnk
This commit is contained in:
Emilio Cobos Álvarez 2018-01-25 02:53:49 +01:00
parent c2dfece49f
commit 657d8b8e31
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
8 changed files with 95 additions and 37 deletions

View file

@ -1194,8 +1194,6 @@ impl LayoutThread {
debug!("Doc sheets changed, flushing author sheets too");
self.stylist.force_stylesheet_origins_dirty(Origin::Author.into());
}
self.stylist.flush(&guards, Some(element));
}
if viewport_size_changed {
@ -1246,6 +1244,8 @@ impl LayoutThread {
debug!("Noting restyle for {:?}: {:?}", el, style_data);
}
self.stylist.flush(&guards, Some(element), Some(&map));
// Create a layout context for use throughout the following passes.
let mut layout_context =
self.build_layout_context(guards.clone(), true, &map);