aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/stylesheet_set.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2017-07-09 04:09:12 +0200
committerEmilio Cobos Álvarez <emilio@crisal.io>2017-07-09 14:17:19 +0200
commit43d58fc01a08a613b1152c46e9d91ac210664b4b (patch)
tree175f6217674514aeb80a938669ef9305e67d088a /components/style/stylesheet_set.rs
parent104e0b473073340689b4bca5c128c61632d4e58d (diff)
downloadservo-43d58fc01a08a613b1152c46e9d91ac210664b4b.tar.gz
servo-43d58fc01a08a613b1152c46e9d91ac210664b4b.zip
stylo: Run the stylehseet invalidation pass also for stylesheet removals.
People apparently do all sorts of silly stuff with stylesheets, see Google Inbox in bug 1379203. Bug: 1379433 Reviewed-By: heycam MozReview-Commit-ID: 4x2d3glOFu8
Diffstat (limited to 'components/style/stylesheet_set.rs')
-rw-r--r--components/style/stylesheet_set.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/components/style/stylesheet_set.rs b/components/style/stylesheet_set.rs
index 07ef6fe24b2..f38ff22d535 100644
--- a/components/style/stylesheet_set.rs
+++ b/components/style/stylesheet_set.rs
@@ -125,8 +125,8 @@ where
stylist: &Stylist,
sheet: S,
before_sheet: S,
- guard: &SharedRwLockReadGuard)
- {
+ guard: &SharedRwLockReadGuard
+ ) {
debug!("StylesheetSet::insert_stylesheet_before");
self.remove_stylesheet_if_present(&sheet);
let index = self.entries.iter().position(|entry| {
@@ -142,12 +142,20 @@ where
}
/// Remove a given stylesheet from the set.
- pub fn remove_stylesheet(&mut self, sheet: S) {
+ pub fn remove_stylesheet(
+ &mut self,
+ stylist: &Stylist,
+ sheet: S,
+ guard: &SharedRwLockReadGuard,
+ ) {
debug!("StylesheetSet::remove_stylesheet");
self.remove_stylesheet_if_present(&sheet);
self.dirty = true;
- // FIXME(emilio): We can do better!
- self.invalidations.invalidate_fully();
+ self.invalidations.collect_invalidations_for(
+ stylist,
+ &sheet,
+ guard
+ );
}
/// Notes that the author style has been disabled for this document.