diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-01-25 02:53:49 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-01-27 02:34:27 +0100 |
commit | 657d8b8e31d0a026bc630d238b77076bb69117eb (patch) | |
tree | aaf2255e0aedc320b01a124683ab68c4176eeb95 /components/style/stylesheet_set.rs | |
parent | c2dfece49f1d59f51a3207cd3d88c282ee1adf70 (diff) | |
download | servo-657d8b8e31d0a026bc630d238b77076bb69117eb.tar.gz servo-657d8b8e31d0a026bc630d238b77076bb69117eb.zip |
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
Diffstat (limited to 'components/style/stylesheet_set.rs')
-rw-r--r-- | components/style/stylesheet_set.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/components/style/stylesheet_set.rs b/components/style/stylesheet_set.rs index c3cc0c7799d..b50c18cf14e 100644 --- a/components/style/stylesheet_set.rs +++ b/components/style/stylesheet_set.rs @@ -7,6 +7,7 @@ use dom::TElement; use invalidation::stylesheets::StylesheetInvalidationSet; use media_queries::Device; +use selector_parser::SnapshotMap; use shared_lock::SharedRwLockReadGuard; use std::slice; use stylesheets::{Origin, OriginSet, OriginSetIterator, PerOrigin, StylesheetInDocument}; @@ -502,6 +503,7 @@ where pub fn flush<'a, E>( &'a mut self, document_element: Option<E>, + snapshots: Option<&SnapshotMap>, ) -> StylesheetFlusher<'a, S> where E: TElement, @@ -510,7 +512,9 @@ where debug!("StylesheetSet::flush"); - let had_invalidations = self.invalidations.flush(document_element); + let had_invalidations = + self.invalidations.flush(document_element, snapshots); + let origins_dirty = mem::replace(&mut self.origins_dirty, OriginSet::empty()); |