mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Add FFI for debug info of CSSStyleRule
This commit is contained in:
parent
9ee2ec5a35
commit
3c5871f83a
2 changed files with 11 additions and 0 deletions
|
@ -1010,6 +1010,10 @@ extern "C" {
|
|||
index: u32)
|
||||
-> RawServoStyleRuleStrong;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_StyleRule_Debug(rule: RawServoStyleRuleBorrowed,
|
||||
result: *mut nsACString_internal);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_StyleRule_GetStyle(rule: RawServoStyleRuleBorrowed)
|
||||
-> RawServoDeclarationBlockStrong;
|
||||
|
|
|
@ -324,6 +324,13 @@ pub extern "C" fn Servo_StyleRule_Release(rule: RawServoStyleRuleBorrowed) -> ()
|
|||
unsafe { RwLock::<StyleRule>::release(rule) };
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleRule_Debug(rule: RawServoStyleRuleBorrowed, result: *mut nsACString) -> () {
|
||||
let rule = RwLock::<StyleRule>::as_arc(&rule);
|
||||
let result = unsafe { result.as_mut().unwrap() };
|
||||
write!(result, "{:?}", *rule.read()).unwrap();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleRule_GetStyle(rule: RawServoStyleRuleBorrowed) -> RawServoDeclarationBlockStrong {
|
||||
let rule = RwLock::<StyleRule>::as_arc(&rule);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue