mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
style: Make Shadow DOM not use XBL anymore.
More improvements to come. In particular, this still iterates through Shadow DOM in each_xbl_cascade_data, but that should be changed later. That allows to cleanup a bunch of stuff and finally fix Shadow DOM cascade order. We still rely on the binding parent to be setup properly in the shadow tree, but that requirement can go away later (we can walk the containing shadow chain instead). This mostly focuses on removing the XBL binding from the Shadow host. It'd be nice to do EnumerateShadowRoots faster. I think that should also be a followup, if needed. Bug: 1425759 Reviewed-by: xidorn MozReview-Commit-ID: Jf2iGvLC5de
This commit is contained in:
parent
28ea593347
commit
cfbdf3d694
2 changed files with 58 additions and 7 deletions
|
@ -1149,6 +1149,40 @@ pub unsafe extern "C" fn Servo_AuthorStyles_AppendStyleSheet(
|
|||
styles.stylesheets.append_stylesheet(None, sheet, &guard);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn Servo_AuthorStyles_InsertStyleSheetBefore(
|
||||
styles: RawServoAuthorStylesBorrowedMut,
|
||||
sheet: *const ServoStyleSheet,
|
||||
before_sheet: *const ServoStyleSheet,
|
||||
) {
|
||||
let styles = AuthorStyles::<GeckoStyleSheet>::from_ffi_mut(styles);
|
||||
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let guard = global_style_data.shared_lock.read();
|
||||
styles.stylesheets.insert_stylesheet_before(
|
||||
None,
|
||||
GeckoStyleSheet::new(sheet),
|
||||
GeckoStyleSheet::new(before_sheet),
|
||||
&guard,
|
||||
);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn Servo_AuthorStyles_RemoveStyleSheet(
|
||||
styles: RawServoAuthorStylesBorrowedMut,
|
||||
sheet: *const ServoStyleSheet,
|
||||
) {
|
||||
let styles = AuthorStyles::<GeckoStyleSheet>::from_ffi_mut(styles);
|
||||
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let guard = global_style_data.shared_lock.read();
|
||||
styles.stylesheets.remove_stylesheet(
|
||||
None,
|
||||
GeckoStyleSheet::new(sheet),
|
||||
&guard,
|
||||
);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn Servo_AuthorStyles_ForceDirty(
|
||||
styles: RawServoAuthorStylesBorrowedMut,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue