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

@ -877,7 +877,8 @@ pub extern "C" fn Servo_StyleSet_InsertStyleSheetBefore(
&data.stylist,
unsafe { GeckoStyleSheet::new(sheet) },
unsafe { GeckoStyleSheet::new(before_sheet) },
&guard);
&guard,
);
data.clear_stylist();
}
@ -886,8 +887,15 @@ pub extern "C" fn Servo_StyleSet_RemoveStyleSheet(
raw_data: RawServoStyleSetBorrowed,
sheet: *const ServoStyleSheet
) {
let global_style_data = &*GLOBAL_STYLE_DATA;
let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
data.stylesheets.remove_stylesheet(unsafe { GeckoStyleSheet::new(sheet) });
let mut data = &mut *data;
let guard = global_style_data.shared_lock.read();
data.stylesheets.remove_stylesheet(
&data.stylist,
unsafe { GeckoStyleSheet::new(sheet) },
&guard,
);
data.clear_stylist();
}