mirror of
https://github.com/servo/servo.git
synced 2025-08-13 01:15:34 +01:00
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:
parent
104e0b4730
commit
43d58fc01a
2 changed files with 23 additions and 7 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue