mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Auto merge of #16798 - bzbarsky:stylist-lazier-updates, r=emilio
Allow stylo to do lazier stylist rebuilds --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix https://bugzilla.mozilla.org/show_bug.cgi?id=1361843 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because it's optimization, which should have no observable behavior difference. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16798) <!-- Reviewable:end -->
This commit is contained in:
commit
c6c0252b19
4 changed files with 105 additions and 59 deletions
|
@ -619,60 +619,40 @@ pub extern "C" fn Servo_StyleSheet_ClearAndUpdate(stylesheet: RawServoStyleSheet
|
|||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSet_AppendStyleSheet(raw_data: RawServoStyleSetBorrowed,
|
||||
raw_sheet: RawServoStyleSheetBorrowed,
|
||||
unique_id: u32,
|
||||
flush: bool) {
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let guard = global_style_data.shared_lock.read();
|
||||
unique_id: u32) {
|
||||
let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
|
||||
let sheet = HasArcFFI::as_arc(&raw_sheet);
|
||||
data.stylesheets.append_stylesheet(sheet, unique_id);
|
||||
if flush {
|
||||
data.flush_stylesheets(&guard);
|
||||
}
|
||||
data.clear_stylist();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSet_PrependStyleSheet(raw_data: RawServoStyleSetBorrowed,
|
||||
raw_sheet: RawServoStyleSheetBorrowed,
|
||||
unique_id: u32,
|
||||
flush: bool) {
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let guard = global_style_data.shared_lock.read();
|
||||
unique_id: u32) {
|
||||
let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
|
||||
let sheet = HasArcFFI::as_arc(&raw_sheet);
|
||||
data.stylesheets.prepend_stylesheet(sheet, unique_id);
|
||||
if flush {
|
||||
data.flush_stylesheets(&guard);
|
||||
}
|
||||
data.clear_stylist();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSet_InsertStyleSheetBefore(raw_data: RawServoStyleSetBorrowed,
|
||||
raw_sheet: RawServoStyleSheetBorrowed,
|
||||
unique_id: u32,
|
||||
before_unique_id: u32,
|
||||
flush: bool) {
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let guard = global_style_data.shared_lock.read();
|
||||
before_unique_id: u32) {
|
||||
let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
|
||||
let sheet = HasArcFFI::as_arc(&raw_sheet);
|
||||
data.stylesheets.insert_stylesheet_before(sheet, unique_id, before_unique_id);
|
||||
if flush {
|
||||
data.flush_stylesheets(&guard);
|
||||
}
|
||||
data.clear_stylist();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSet_RemoveStyleSheet(raw_data: RawServoStyleSetBorrowed,
|
||||
unique_id: u32,
|
||||
flush: bool) {
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let guard = global_style_data.shared_lock.read();
|
||||
unique_id: u32) {
|
||||
let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
|
||||
data.stylesheets.remove_stylesheet(unique_id);
|
||||
if flush {
|
||||
data.flush_stylesheets(&guard);
|
||||
}
|
||||
data.clear_stylist();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -689,6 +669,7 @@ pub extern "C" fn Servo_StyleSet_NoteStyleSheetsChanged(raw_data: RawServoStyleS
|
|||
let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
|
||||
data.stylesheets.force_dirty();
|
||||
data.stylesheets.set_author_style_disabled(author_style_disabled);
|
||||
data.clear_stylist();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue