Add stylo FFI for CSSRuleList

This commit is contained in:
Xidorn Quan 2016-11-23 10:30:48 +11:00
parent 210b1be1d0
commit 9d4ab0d3e9
5 changed files with 105 additions and 4 deletions

View file

@ -3,11 +3,17 @@
pub use nsstring::{nsACString, nsAString};
type nsACString_internal = nsACString;
type nsAString_internal = nsAString;
pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray<usize>;
pub type ServoComputedValuesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoComputedValues>;
pub type ServoComputedValuesBorrowedOrNull<'a> = Option<&'a ServoComputedValues>;
pub type ServoComputedValuesBorrowed<'a> = &'a ServoComputedValues;
enum ServoComputedValuesVoid{ }
pub struct ServoComputedValues(ServoComputedValuesVoid);
pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoCssRules>;
pub type ServoCssRulesBorrowedOrNull<'a> = Option<&'a ServoCssRules>;
pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules;
enum ServoCssRulesVoid{ }
pub struct ServoCssRules(ServoCssRulesVoid);
pub type RawServoStyleSheetStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoStyleSheet>;
pub type RawServoStyleSheetBorrowedOrNull<'a> = Option<&'a RawServoStyleSheet>;
pub type RawServoStyleSheetBorrowed<'a> = &'a RawServoStyleSheet;
@ -188,6 +194,12 @@ unsafe impl Sync for nsStyleXUL {}
pub type RawGeckoNode = nsINode;
pub type RawGeckoElement = Element;
pub type RawGeckoDocument = nsIDocument;
extern "C" {
pub fn Servo_CssRules_AddRef(ptr: ServoCssRulesBorrowed);
}
extern "C" {
pub fn Servo_CssRules_Release(ptr: ServoCssRulesBorrowed);
}
extern "C" {
pub fn Servo_StyleSheet_AddRef(ptr: RawServoStyleSheetBorrowed);
}
@ -950,6 +962,10 @@ extern "C" {
pub fn Servo_StyleSheet_HasRules(sheet: RawServoStyleSheetBorrowed)
-> bool;
}
extern "C" {
pub fn Servo_StyleSheet_GetRules(sheet: RawServoStyleSheetBorrowed)
-> ServoCssRulesStrong;
}
extern "C" {
pub fn Servo_StyleSet_Init() -> RawServoStyleSetOwned;
}
@ -974,6 +990,10 @@ extern "C" {
reference:
RawServoStyleSheetBorrowed);
}
extern "C" {
pub fn Servo_CssRules_ListTypes(rules: ServoCssRulesBorrowed,
result: nsTArrayBorrowed_uintptr_t);
}
extern "C" {
pub fn Servo_ParseProperty(property: *const nsACString_internal,
value: *const nsACString_internal,