Add bindings for namespace rule.

This commit is contained in:
Xidorn Quan 2017-03-15 20:27:48 +11:00
parent f5e24fc0b3
commit c9c21e72b1
5 changed files with 46 additions and 5 deletions

View file

@ -8,7 +8,7 @@
#![allow(non_snake_case, missing_docs)]
use gecko_bindings::bindings::{RawServoMediaList, RawServoMediaRule};
use gecko_bindings::bindings::{RawServoMediaList, RawServoMediaRule, RawServoNamespaceRule};
use gecko_bindings::bindings::{RawServoStyleSheet, RawServoStyleRule, RawServoImportRule};
use gecko_bindings::bindings::{ServoComputedValues, ServoCssRules};
use gecko_bindings::structs::{RawServoAnimationValue, RawServoDeclarationBlock};
@ -17,7 +17,7 @@ use media_queries::MediaList;
use parking_lot::RwLock;
use properties::{ComputedValues, PropertyDeclarationBlock};
use properties::animated_properties::AnimationValue;
use stylesheets::{CssRules, Stylesheet, StyleRule, ImportRule, MediaRule};
use stylesheets::{CssRules, Stylesheet, StyleRule, ImportRule, MediaRule, NamespaceRule};
macro_rules! impl_arc_ffi {
($servo_type:ty => $gecko_type:ty [$addref:ident, $release:ident]) => {
@ -64,3 +64,6 @@ impl_arc_ffi!(RwLock<MediaList> => RawServoMediaList
impl_arc_ffi!(RwLock<MediaRule> => RawServoMediaRule
[Servo_MediaRule_AddRef, Servo_MediaRule_Release]);
impl_arc_ffi!(RwLock<NamespaceRule> => RawServoNamespaceRule
[Servo_NamespaceRule_AddRef, Servo_NamespaceRule_Release]);

View file

@ -4,6 +4,11 @@ pub use nsstring::{nsACString, nsAString, nsString};
type nsACString_internal = nsACString;
type nsAString_internal = nsAString;
use gecko_bindings::structs::mozilla::css::URLValue;
pub type RawServoNamespaceRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoNamespaceRule>;
pub type RawServoNamespaceRuleBorrowedOrNull<'a> = Option<&'a RawServoNamespaceRule>;
pub type RawServoNamespaceRuleBorrowed<'a> = &'a RawServoNamespaceRule;
enum RawServoNamespaceRuleVoid{ }
pub struct RawServoNamespaceRule(RawServoNamespaceRuleVoid);
use gecko_bindings::structs::RawGeckoDocument;
use gecko_bindings::structs::RawGeckoElement;
use gecko_bindings::structs::RawGeckoKeyframeList;
@ -1383,6 +1388,11 @@ extern "C" {
index: u32)
-> RawServoMediaRuleStrong;
}
extern "C" {
pub fn Servo_CssRules_GetNamespaceRuleAt(rules: ServoCssRulesBorrowed,
index: u32)
-> RawServoNamespaceRuleStrong;
}
extern "C" {
pub fn Servo_CssRules_InsertRule(rules: ServoCssRulesBorrowed,
sheet: RawServoStyleSheetBorrowed,
@ -1431,6 +1441,14 @@ extern "C" {
pub fn Servo_MediaRule_GetCssText(rule: RawServoMediaRuleBorrowed,
result: *mut nsAString_internal);
}
extern "C" {
pub fn Servo_NamespaceRule_Debug(rule: RawServoNamespaceRuleBorrowed,
result: *mut nsACString_internal);
}
extern "C" {
pub fn Servo_NamespaceRule_GetCssText(rule: RawServoNamespaceRuleBorrowed,
result: *mut nsAString_internal);
}
extern "C" {
pub fn Servo_ParseProperty(property: *const nsACString_internal,
value: *const nsACString_internal,