mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Add stylo FFI for CSSStyleRule.style
This commit is contained in:
parent
66669e48ef
commit
9ee2ec5a35
2 changed files with 23 additions and 0 deletions
|
@ -1010,6 +1010,15 @@ extern "C" {
|
|||
index: u32)
|
||||
-> RawServoStyleRuleStrong;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_StyleRule_GetStyle(rule: RawServoStyleRuleBorrowed)
|
||||
-> RawServoDeclarationBlockStrong;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_StyleRule_SetStyle(rule: RawServoStyleRuleBorrowed,
|
||||
declarations:
|
||||
RawServoDeclarationBlockBorrowed);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_StyleRule_GetCssText(rule: RawServoStyleRuleBorrowed,
|
||||
result: *mut nsAString_internal);
|
||||
|
|
|
@ -324,6 +324,20 @@ pub extern "C" fn Servo_StyleRule_Release(rule: RawServoStyleRuleBorrowed) -> ()
|
|||
unsafe { RwLock::<StyleRule>::release(rule) };
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleRule_GetStyle(rule: RawServoStyleRuleBorrowed) -> RawServoDeclarationBlockStrong {
|
||||
let rule = RwLock::<StyleRule>::as_arc(&rule);
|
||||
rule.read().block.clone().into_strong()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleRule_SetStyle(rule: RawServoStyleRuleBorrowed,
|
||||
declarations: RawServoDeclarationBlockBorrowed) -> () {
|
||||
let rule = RwLock::<StyleRule>::as_arc(&rule);
|
||||
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
|
||||
rule.write().block = declarations.clone();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleRule_GetCssText(rule: RawServoStyleRuleBorrowed, result: *mut nsAString) -> () {
|
||||
let rule = RwLock::<StyleRule>::as_arc(&rule);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue