mirror of
https://github.com/servo/servo.git
synced 2025-09-11 07:28:19 +01:00
Deep clone ServoStyleSheets.
MozReview-Commit-ID: 6hYIcOa86Y
This commit is contained in:
parent
bb310efbb9
commit
31584e3c14
9 changed files with 221 additions and 10 deletions
|
@ -792,6 +792,12 @@ pub extern "C" fn Servo_StyleSheet_GetRules(sheet: RawServoStyleSheetBorrowed) -
|
|||
Stylesheet::as_arc(&sheet).rules.clone().into_strong()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSheet_Clone(raw_sheet: RawServoStyleSheetBorrowed) -> RawServoStyleSheetStrong {
|
||||
let sheet: &Arc<Stylesheet> = HasArcFFI::as_arc(&raw_sheet);
|
||||
Arc::new(sheet.as_ref().clone()).into_strong()
|
||||
}
|
||||
|
||||
fn read_locked_arc<T, R, F>(raw: &<Locked<T> as HasFFI>::FFIType, func: F) -> R
|
||||
where Locked<T>: HasArcFFI, F: FnOnce(&T) -> R
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue