diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs index 348f27fc878..c00e7149da6 100644 --- a/components/style/gecko_bindings/bindings.rs +++ b/components/style/gecko_bindings/bindings.rs @@ -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; diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 103f680507c..e65c8cbd5bd 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -324,6 +324,13 @@ pub extern "C" fn Servo_StyleRule_Release(rule: RawServoStyleRuleBorrowed) -> () unsafe { RwLock::::release(rule) }; } +#[no_mangle] +pub extern "C" fn Servo_StyleRule_Debug(rule: RawServoStyleRuleBorrowed, result: *mut nsACString) -> () { + let rule = RwLock::::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::::as_arc(&rule);