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
This commit is contained in:
Emilio Cobos Álvarez 2017-07-09 04:09:12 +02:00
parent 104e0b4730
commit 43d58fc01a
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 23 additions and 7 deletions

View file

@ -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.