mirror of
https://github.com/servo/servo.git
synced 2025-09-01 18:48:23 +01:00
Bug 1367615 - Stylo: implement inIDOMUtils.getSelectorCount and inIDOMUtils.getSelectorTextFromIndex
This commit is contained in:
parent
7e273d6c9b
commit
36f3255484
3 changed files with 47 additions and 9 deletions
|
@ -1156,6 +1156,25 @@ pub extern "C" fn Servo_StyleRule_GetSelectorText(rule: RawServoStyleRuleBorrowe
|
|||
})
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleRule_GetSelectorTextFromIndex(rule: RawServoStyleRuleBorrowed,
|
||||
aSelectorIndex: u32,
|
||||
result: *mut nsAString) {
|
||||
read_locked_arc(rule, |rule: &StyleRule| {
|
||||
rule.selectors.to_css_from_index(
|
||||
aSelectorIndex as usize,
|
||||
unsafe { result.as_mut().unwrap() }
|
||||
).unwrap();
|
||||
})
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleRule_GetSelectorCount(rule: RawServoStyleRuleBorrowed, count: *mut u32) {
|
||||
read_locked_arc(rule, |rule: &StyleRule| {
|
||||
*unsafe { count.as_mut().unwrap() } = rule.selectors.0.len() as u32;
|
||||
})
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ImportRule_GetHref(rule: RawServoImportRuleBorrowed, result: *mut nsAString) {
|
||||
read_locked_arc(rule, |rule: &ImportRule| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue