diff options
-rw-r--r-- | components/style/gecko_bindings/bindings.rs | 8 | ||||
-rw-r--r-- | ports/geckolib/glue.rs | 13 |
2 files changed, 21 insertions, 0 deletions
diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs index ef0086edde1..0513cc695ac 100644 --- a/components/style/gecko_bindings/bindings.rs +++ b/components/style/gecko_bindings/bindings.rs @@ -1011,6 +1011,14 @@ extern "C" { -> RawServoStyleRuleStrong; } extern "C" { + pub fn Servo_StyleRule_GetCssText(rule: RawServoStyleRuleBorrowed, + result: *mut nsAString_internal); +} +extern "C" { + pub fn Servo_StyleRule_GetSelectorText(rule: RawServoStyleRuleBorrowed, + result: *mut nsAString_internal); +} +extern "C" { pub fn Servo_ParseProperty(property: *const nsACString_internal, value: *const nsACString_internal, base_url: *const nsACString_internal, diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 11ef9d7701c..8fed9eb8a66 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -4,6 +4,7 @@ use app_units::Au; use cssparser::Parser; +use cssparser::ToCss as ParserToCss; use env_logger; use euclid::Size2D; use parking_lot::RwLock; @@ -324,6 +325,18 @@ pub extern "C" fn Servo_StyleRule_Release(rule: RawServoStyleRuleBorrowed) -> () } #[no_mangle] +pub extern "C" fn Servo_StyleRule_GetCssText(rule: RawServoStyleRuleBorrowed, result: *mut nsAString) -> () { + let rule = RwLock::<StyleRule>::as_arc(&rule); + rule.read().to_css(unsafe { result.as_mut().unwrap() }).unwrap(); +} + +#[no_mangle] +pub extern "C" fn Servo_StyleRule_GetSelectorText(rule: RawServoStyleRuleBorrowed, result: *mut nsAString) -> () { + let rule = RwLock::<StyleRule>::as_arc(&rule); + rule.read().selectors.to_css(unsafe { result.as_mut().unwrap() }).unwrap(); +} + +#[no_mangle] pub extern "C" fn Servo_ComputedValues_Get(node: RawGeckoNodeBorrowed) -> ServoComputedValuesStrong { let node = GeckoNode(node); |