stylo: Add FFI function to make the Stylist realize we have modified style sheets.

This commit is contained in:
Cameron McCormack 2016-12-19 13:42:23 +08:00
parent 11dffa8958
commit 5d75143e8f

View file

@ -318,6 +318,12 @@ pub extern "C" fn Servo_StyleSet_RemoveStyleSheet(raw_data: RawServoStyleSetBorr
data.stylesheets_changed = true; data.stylesheets_changed = true;
} }
#[no_mangle]
pub extern "C" fn Servo_StyleSet_NoteStyleSheetsChanged(raw_data: RawServoStyleSetBorrowed) {
let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
data.stylesheets_changed = true;
}
#[no_mangle] #[no_mangle]
pub extern "C" fn Servo_StyleSheet_HasRules(raw_sheet: RawServoStyleSheetBorrowed) -> bool { pub extern "C" fn Servo_StyleSheet_HasRules(raw_sheet: RawServoStyleSheetBorrowed) -> bool {
!Stylesheet::as_arc(&raw_sheet).rules.read().0.is_empty() !Stylesheet::as_arc(&raw_sheet).rules.read().0.is_empty()