mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Enable querying counter-style rule on Servo backend.
This commit is contained in:
parent
0667287bf6
commit
3e00a91e20
3 changed files with 52 additions and 12 deletions
|
@ -2384,6 +2384,19 @@ pub extern "C" fn Servo_StyleSet_GetFontFaceRules(raw_data: RawServoStyleSetBorr
|
|||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSet_GetCounterStyleRule(raw_data: RawServoStyleSetBorrowed,
|
||||
name: *mut nsIAtom) -> *mut nsCSSCounterStyleRule {
|
||||
let data = PerDocumentStyleData::from_ffi(raw_data).borrow();
|
||||
unsafe {
|
||||
Atom::with(name, |name| data.counter_styles.get(name))
|
||||
}.map(|rule| {
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let guard = global_style_data.shared_lock.read();
|
||||
rule.read_with(&guard).get()
|
||||
}).unwrap_or(ptr::null_mut())
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSet_ResolveForDeclarations(raw_data: RawServoStyleSetBorrowed,
|
||||
parent_style_or_null: ServoComputedValuesBorrowedOrNull,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue