mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Add stylo FFI for cssText getters of CSSStyleRule
This commit is contained in:
parent
a9296bc89c
commit
66669e48ef
2 changed files with 21 additions and 0 deletions
|
@ -1010,6 +1010,14 @@ extern "C" {
|
|||
index: u32)
|
||||
-> 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,
|
||||
|
|
|
@ -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;
|
||||
|
@ -323,6 +324,18 @@ pub extern "C" fn Servo_StyleRule_Release(rule: RawServoStyleRuleBorrowed) -> ()
|
|||
unsafe { RwLock::<StyleRule>::release(rule) };
|
||||
}
|
||||
|
||||
#[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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue