Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement access to CSSStyleRule for stylo #14330

Merged
merged 5 commits into from Nov 24, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Add FFI for debug info of CSSStyleRule

  • Loading branch information
upsuper committed Nov 23, 2016
commit 3c5871f83a66df709ae8f583f6f4fdb30e8cd911
@@ -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);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.