Auto merge of #16005 - hiikezoe:animation-compose, r=heycam

Compose animation with servo's hashmap

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1340958

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] These changes do not require tests because it's for stylo.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16005)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-03-17 03:09:31 -07:00 committed by GitHub
commit 36234d717f
11 changed files with 991 additions and 917 deletions

View file

@ -420,7 +420,7 @@ mod bindings {
"mozilla::DefaultDelete", "mozilla::DefaultDelete",
"mozilla::Side", "mozilla::Side",
"mozilla::binding_danger::AssertAndSuppressCleanupPolicy", "mozilla::binding_danger::AssertAndSuppressCleanupPolicy",
"RawServoAnimationValueBorrowedListBorrowed", "RawServoAnimationValueMapBorrowed",
]; ];
let opaque_types = [ let opaque_types = [
"std::pair__PCCP", "std::pair__PCCP",
@ -541,6 +541,7 @@ mod bindings {
"RawGeckoNode", "RawGeckoNode",
"RawGeckoAnimationValueList", "RawGeckoAnimationValueList",
"RawServoAnimationValue", "RawServoAnimationValue",
"RawServoAnimationValueMap",
"RawServoDeclarationBlock", "RawServoDeclarationBlock",
"RawGeckoPresContext", "RawGeckoPresContext",
"RawGeckoPresContextOwned", "RawGeckoPresContextOwned",
@ -620,7 +621,6 @@ mod bindings {
"Loader", "Loader",
"ServoStyleSheet", "ServoStyleSheet",
"EffectCompositor_CascadeLevel", "EffectCompositor_CascadeLevel",
"RawServoAnimationValueBorrowedListBorrowed",
]; ];
struct ArrayType { struct ArrayType {
cpp_type: &'static str, cpp_type: &'static str,

View file

@ -259,6 +259,18 @@ pub trait TElement : PartialEq + Debug + Sized + Copy + Clone + ElementExt + Pre
AnimationRules(None, None) AnimationRules(None, None)
} }
/// Get this element's animation rule.
fn get_animation_rule(&self, _pseudo: Option<&PseudoElement>)
-> Option<Arc<RwLock<PropertyDeclarationBlock>>> {
None
}
/// Get this element's transition rule.
fn get_transition_rule(&self, _pseudo: Option<&PseudoElement>)
-> Option<Arc<RwLock<PropertyDeclarationBlock>>> {
None
}
/// Get this element's state, for non-tree-structural pseudos. /// Get this element's state, for non-tree-structural pseudos.
fn get_state(&self) -> ElementState; fn get_state(&self) -> ElementState;

View file

@ -11,12 +11,12 @@
use gecko_bindings::bindings::{RawServoMediaList, RawServoMediaRule, RawServoNamespaceRule}; use gecko_bindings::bindings::{RawServoMediaList, RawServoMediaRule, RawServoNamespaceRule};
use gecko_bindings::bindings::{RawServoStyleSheet, RawServoStyleRule, RawServoImportRule}; use gecko_bindings::bindings::{RawServoStyleSheet, RawServoStyleRule, RawServoImportRule};
use gecko_bindings::bindings::{ServoComputedValues, ServoCssRules}; use gecko_bindings::bindings::{ServoComputedValues, ServoCssRules};
use gecko_bindings::structs::{RawServoAnimationValue, RawServoDeclarationBlock}; use gecko_bindings::structs::{RawServoAnimationValue, RawServoAnimationValueMap, RawServoDeclarationBlock};
use gecko_bindings::sugar::ownership::{HasArcFFI, HasFFI}; use gecko_bindings::sugar::ownership::{HasArcFFI, HasFFI};
use media_queries::MediaList; use media_queries::MediaList;
use parking_lot::RwLock; use parking_lot::RwLock;
use properties::{ComputedValues, PropertyDeclarationBlock}; use properties::{ComputedValues, PropertyDeclarationBlock};
use properties::animated_properties::AnimationValue; use properties::animated_properties::{AnimationValue, AnimationValueMap};
use stylesheets::{CssRules, Stylesheet, StyleRule, ImportRule, MediaRule, NamespaceRule}; use stylesheets::{CssRules, Stylesheet, StyleRule, ImportRule, MediaRule, NamespaceRule};
macro_rules! impl_arc_ffi { macro_rules! impl_arc_ffi {
@ -59,6 +59,9 @@ impl_arc_ffi!(RwLock<ImportRule> => RawServoImportRule
impl_arc_ffi!(AnimationValue => RawServoAnimationValue impl_arc_ffi!(AnimationValue => RawServoAnimationValue
[Servo_AnimationValue_AddRef, Servo_AnimationValue_Release]); [Servo_AnimationValue_AddRef, Servo_AnimationValue_Release]);
impl_arc_ffi!(RwLock<AnimationValueMap> => RawServoAnimationValueMap
[Servo_AnimationValueMap_AddRef, Servo_AnimationValueMap_Release]);
impl_arc_ffi!(RwLock<MediaList> => RawServoMediaList impl_arc_ffi!(RwLock<MediaList> => RawServoMediaList
[Servo_MediaList_AddRef, Servo_MediaList_Release]); [Servo_MediaList_AddRef, Servo_MediaList_Release]);

View file

@ -46,6 +46,7 @@ use parking_lot::RwLock;
use parser::ParserContextExtraData; use parser::ParserContextExtraData;
use properties::{ComputedValues, parse_style_attribute}; use properties::{ComputedValues, parse_style_attribute};
use properties::PropertyDeclarationBlock; use properties::PropertyDeclarationBlock;
use properties::animated_properties::AnimationValueMap;
use rule_tree::CascadeLevel as ServoCascadeLevel; use rule_tree::CascadeLevel as ServoCascadeLevel;
use selector_parser::{ElementExt, Snapshot}; use selector_parser::{ElementExt, Snapshot};
use selectors::Element; use selectors::Element;
@ -403,6 +404,20 @@ fn selector_flags_to_node_flags(flags: ElementSelectorFlags) -> u32 {
gecko_flags gecko_flags
} }
fn get_animation_rule(element: &GeckoElement,
pseudo: Option<&PseudoElement>,
cascade_level: CascadeLevel)
-> Option<Arc<RwLock<PropertyDeclarationBlock>>> {
let atom_ptr = PseudoElement::ns_atom_or_null_from_opt(pseudo);
let animation_values = Arc::new(RwLock::new(AnimationValueMap::new()));
if unsafe { Gecko_GetAnimationRule(element.0, atom_ptr, cascade_level,
HasArcFFI::arc_as_borrowed(&animation_values)) } {
Some(Arc::new(RwLock::new(PropertyDeclarationBlock::from_animation_value_map(&animation_values.read()))))
} else {
None
}
}
impl<'le> TElement for GeckoElement<'le> { impl<'le> TElement for GeckoElement<'le> {
type ConcreteNode = GeckoNode<'le>; type ConcreteNode = GeckoNode<'le>;
@ -416,12 +431,18 @@ impl<'le> TElement for GeckoElement<'le> {
} }
fn get_animation_rules(&self, pseudo: Option<&PseudoElement>) -> AnimationRules { fn get_animation_rules(&self, pseudo: Option<&PseudoElement>) -> AnimationRules {
let atom_ptr = PseudoElement::ns_atom_or_null_from_opt(pseudo); AnimationRules(self.get_animation_rule(pseudo),
unsafe { self.get_transition_rule(pseudo))
AnimationRules( }
Gecko_GetAnimationRule(self.0, atom_ptr, CascadeLevel::Animations).into_arc_opt(),
Gecko_GetAnimationRule(self.0, atom_ptr, CascadeLevel::Transitions).into_arc_opt()) fn get_animation_rule(&self, pseudo: Option<&PseudoElement>)
} -> Option<Arc<RwLock<PropertyDeclarationBlock>>> {
get_animation_rule(self, pseudo, CascadeLevel::Animations)
}
fn get_transition_rule(&self, pseudo: Option<&PseudoElement>)
-> Option<Arc<RwLock<PropertyDeclarationBlock>>> {
get_animation_rule(self, pseudo, CascadeLevel::Transitions)
} }
fn get_state(&self) -> ElementState { fn get_state(&self) -> ElementState {

View file

@ -4,11 +4,6 @@ pub use nsstring::{nsACString, nsAString, nsString};
type nsACString_internal = nsACString; type nsACString_internal = nsACString;
type nsAString_internal = nsAString; type nsAString_internal = nsAString;
use gecko_bindings::structs::mozilla::css::URLValue; 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::RawGeckoDocument;
use gecko_bindings::structs::RawGeckoElement; use gecko_bindings::structs::RawGeckoElement;
use gecko_bindings::structs::RawGeckoKeyframeList; use gecko_bindings::structs::RawGeckoKeyframeList;
@ -16,6 +11,7 @@ use gecko_bindings::structs::RawGeckoComputedKeyframeValuesList;
use gecko_bindings::structs::RawGeckoNode; use gecko_bindings::structs::RawGeckoNode;
use gecko_bindings::structs::RawGeckoAnimationValueList; use gecko_bindings::structs::RawGeckoAnimationValueList;
use gecko_bindings::structs::RawServoAnimationValue; use gecko_bindings::structs::RawServoAnimationValue;
use gecko_bindings::structs::RawServoAnimationValueMap;
use gecko_bindings::structs::RawServoDeclarationBlock; use gecko_bindings::structs::RawServoDeclarationBlock;
use gecko_bindings::structs::RawGeckoPresContext; use gecko_bindings::structs::RawGeckoPresContext;
use gecko_bindings::structs::RawGeckoPresContextOwned; use gecko_bindings::structs::RawGeckoPresContextOwned;
@ -179,7 +175,6 @@ use gecko_bindings::structs::nsresult;
use gecko_bindings::structs::Loader; use gecko_bindings::structs::Loader;
use gecko_bindings::structs::ServoStyleSheet; use gecko_bindings::structs::ServoStyleSheet;
use gecko_bindings::structs::EffectCompositor_CascadeLevel; use gecko_bindings::structs::EffectCompositor_CascadeLevel;
use gecko_bindings::structs::RawServoAnimationValueBorrowedListBorrowed;
pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray<usize>; pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray<usize>;
pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoCssRules>; pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoCssRules>;
pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules; pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules;
@ -212,6 +207,9 @@ pub struct RawServoImportRule(RawServoImportRuleVoid);
pub type RawServoAnimationValueStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoAnimationValue>; pub type RawServoAnimationValueStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoAnimationValue>;
pub type RawServoAnimationValueBorrowed<'a> = &'a RawServoAnimationValue; pub type RawServoAnimationValueBorrowed<'a> = &'a RawServoAnimationValue;
pub type RawServoAnimationValueBorrowedOrNull<'a> = Option<&'a RawServoAnimationValue>; pub type RawServoAnimationValueBorrowedOrNull<'a> = Option<&'a RawServoAnimationValue>;
pub type RawServoAnimationValueMapStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoAnimationValueMap>;
pub type RawServoAnimationValueMapBorrowed<'a> = &'a RawServoAnimationValueMap;
pub type RawServoAnimationValueMapBorrowedOrNull<'a> = Option<&'a RawServoAnimationValueMap>;
pub type RawServoMediaListStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoMediaList>; pub type RawServoMediaListStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoMediaList>;
pub type RawServoMediaListBorrowed<'a> = &'a RawServoMediaList; pub type RawServoMediaListBorrowed<'a> = &'a RawServoMediaList;
pub type RawServoMediaListBorrowedOrNull<'a> = Option<&'a RawServoMediaList>; pub type RawServoMediaListBorrowedOrNull<'a> = Option<&'a RawServoMediaList>;
@ -222,6 +220,11 @@ pub type RawServoMediaRuleBorrowed<'a> = &'a RawServoMediaRule;
pub type RawServoMediaRuleBorrowedOrNull<'a> = Option<&'a RawServoMediaRule>; pub type RawServoMediaRuleBorrowedOrNull<'a> = Option<&'a RawServoMediaRule>;
enum RawServoMediaRuleVoid { } enum RawServoMediaRuleVoid { }
pub struct RawServoMediaRule(RawServoMediaRuleVoid); pub struct RawServoMediaRule(RawServoMediaRuleVoid);
pub type RawServoNamespaceRuleStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoNamespaceRule>;
pub type RawServoNamespaceRuleBorrowed<'a> = &'a RawServoNamespaceRule;
pub type RawServoNamespaceRuleBorrowedOrNull<'a> = Option<&'a RawServoNamespaceRule>;
enum RawServoNamespaceRuleVoid { }
pub struct RawServoNamespaceRule(RawServoNamespaceRuleVoid);
pub type RawServoStyleSetOwned = ::gecko_bindings::sugar::ownership::Owned<RawServoStyleSet>; pub type RawServoStyleSetOwned = ::gecko_bindings::sugar::ownership::Owned<RawServoStyleSet>;
pub type RawServoStyleSetOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<RawServoStyleSet>; pub type RawServoStyleSetOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull<RawServoStyleSet>;
pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet; pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet;
@ -325,6 +328,14 @@ extern "C" {
extern "C" { extern "C" {
pub fn Servo_AnimationValue_Release(ptr: RawServoAnimationValueBorrowed); pub fn Servo_AnimationValue_Release(ptr: RawServoAnimationValueBorrowed);
} }
extern "C" {
pub fn Servo_AnimationValueMap_AddRef(ptr:
RawServoAnimationValueMapBorrowed);
}
extern "C" {
pub fn Servo_AnimationValueMap_Release(ptr:
RawServoAnimationValueMapBorrowed);
}
extern "C" { extern "C" {
pub fn Servo_MediaList_AddRef(ptr: RawServoMediaListBorrowed); pub fn Servo_MediaList_AddRef(ptr: RawServoMediaListBorrowed);
} }
@ -337,6 +348,12 @@ extern "C" {
extern "C" { extern "C" {
pub fn Servo_MediaRule_Release(ptr: RawServoMediaRuleBorrowed); pub fn Servo_MediaRule_Release(ptr: RawServoMediaRuleBorrowed);
} }
extern "C" {
pub fn Servo_NamespaceRule_AddRef(ptr: RawServoNamespaceRuleBorrowed);
}
extern "C" {
pub fn Servo_NamespaceRule_Release(ptr: RawServoNamespaceRuleBorrowed);
}
extern "C" { extern "C" {
pub fn Servo_StyleSet_Drop(ptr: RawServoStyleSetOwned); pub fn Servo_StyleSet_Drop(ptr: RawServoStyleSetOwned);
} }
@ -564,8 +581,10 @@ extern "C" {
pub fn Gecko_GetAnimationRule(aElement: RawGeckoElementBorrowed, pub fn Gecko_GetAnimationRule(aElement: RawGeckoElementBorrowed,
aPseudoTag: *mut nsIAtom, aPseudoTag: *mut nsIAtom,
aCascadeLevel: aCascadeLevel:
EffectCompositor_CascadeLevel) EffectCompositor_CascadeLevel,
-> RawServoDeclarationBlockStrong; aAnimationValues:
RawServoAnimationValueMapBorrowed)
-> bool;
} }
extern "C" { extern "C" {
pub fn Gecko_StyleAnimationsEquals(arg1: pub fn Gecko_StyleAnimationsEquals(arg1:
@ -1296,10 +1315,9 @@ extern "C" {
pub fn Servo_StyleSheet_FromUTF8Bytes(loader: *mut Loader, pub fn Servo_StyleSheet_FromUTF8Bytes(loader: *mut Loader,
gecko_stylesheet: gecko_stylesheet:
*mut ServoStyleSheet, *mut ServoStyleSheet,
data: *const nsACString_internal, data: *const nsACString,
parsing_mode: SheetParsingMode, parsing_mode: SheetParsingMode,
base_url: base_url: *const nsACString,
*const nsACString_internal,
base: *mut ThreadSafeURIHolder, base: *mut ThreadSafeURIHolder,
referrer: *mut ThreadSafeURIHolder, referrer: *mut ThreadSafeURIHolder,
principal: principal:
@ -1316,7 +1334,7 @@ extern "C" {
loader: *mut Loader, loader: *mut Loader,
gecko_stylesheet: gecko_stylesheet:
*mut ServoStyleSheet, *mut ServoStyleSheet,
data: *const nsACString_internal, data: *const nsACString,
base: *mut ThreadSafeURIHolder, base: *mut ThreadSafeURIHolder,
referrer: *mut ThreadSafeURIHolder, referrer: *mut ThreadSafeURIHolder,
principal: principal:
@ -1370,8 +1388,7 @@ extern "C" {
} }
extern "C" { extern "C" {
pub fn Servo_StyleSet_FillKeyframesForName(set: RawServoStyleSetBorrowed, pub fn Servo_StyleSet_FillKeyframesForName(set: RawServoStyleSetBorrowed,
property: property: *const nsACString,
*const nsACString_internal,
timing_function: timing_function:
*const nsTimingFunction, *const nsTimingFunction,
computed_values: computed_values:
@ -1384,35 +1401,55 @@ extern "C" {
pub fn Servo_CssRules_ListTypes(rules: ServoCssRulesBorrowed, pub fn Servo_CssRules_ListTypes(rules: ServoCssRulesBorrowed,
result: nsTArrayBorrowed_uintptr_t); result: nsTArrayBorrowed_uintptr_t);
} }
extern "C" {
pub fn Servo_CssRules_InsertRule(rules: ServoCssRulesBorrowed,
sheet: RawServoStyleSheetBorrowed,
rule: *const nsACString, index: u32,
nested: bool, rule_type: *mut u16)
-> nsresult;
}
extern "C" {
pub fn Servo_CssRules_DeleteRule(rules: ServoCssRulesBorrowed, index: u32)
-> nsresult;
}
extern "C" { extern "C" {
pub fn Servo_CssRules_GetStyleRuleAt(rules: ServoCssRulesBorrowed, pub fn Servo_CssRules_GetStyleRuleAt(rules: ServoCssRulesBorrowed,
index: u32) index: u32)
-> RawServoStyleRuleStrong; -> RawServoStyleRuleStrong;
} }
extern "C" {
pub fn Servo_StyleRule_Debug(rule: RawServoStyleRuleBorrowed,
result: *mut nsACString);
}
extern "C" {
pub fn Servo_StyleRule_GetCssText(rule: RawServoStyleRuleBorrowed,
result: *mut nsAString);
}
extern "C" { extern "C" {
pub fn Servo_CssRules_GetMediaRuleAt(rules: ServoCssRulesBorrowed, pub fn Servo_CssRules_GetMediaRuleAt(rules: ServoCssRulesBorrowed,
index: u32) index: u32)
-> RawServoMediaRuleStrong; -> RawServoMediaRuleStrong;
} }
extern "C" {
pub fn Servo_MediaRule_Debug(rule: RawServoMediaRuleBorrowed,
result: *mut nsACString);
}
extern "C" {
pub fn Servo_MediaRule_GetCssText(rule: RawServoMediaRuleBorrowed,
result: *mut nsAString);
}
extern "C" { extern "C" {
pub fn Servo_CssRules_GetNamespaceRuleAt(rules: ServoCssRulesBorrowed, pub fn Servo_CssRules_GetNamespaceRuleAt(rules: ServoCssRulesBorrowed,
index: u32) index: u32)
-> RawServoNamespaceRuleStrong; -> RawServoNamespaceRuleStrong;
} }
extern "C" { extern "C" {
pub fn Servo_CssRules_InsertRule(rules: ServoCssRulesBorrowed, pub fn Servo_NamespaceRule_Debug(rule: RawServoNamespaceRuleBorrowed,
sheet: RawServoStyleSheetBorrowed, result: *mut nsACString);
rule: *const nsACString_internal,
index: u32, nested: bool,
rule_type: *mut u16) -> nsresult;
} }
extern "C" { extern "C" {
pub fn Servo_CssRules_DeleteRule(rules: ServoCssRulesBorrowed, index: u32) pub fn Servo_NamespaceRule_GetCssText(rule: RawServoNamespaceRuleBorrowed,
-> nsresult; result: *mut nsAString);
}
extern "C" {
pub fn Servo_StyleRule_Debug(rule: RawServoStyleRuleBorrowed,
result: *mut nsACString_internal);
} }
extern "C" { extern "C" {
pub fn Servo_StyleRule_GetStyle(rule: RawServoStyleRuleBorrowed) pub fn Servo_StyleRule_GetStyle(rule: RawServoStyleRuleBorrowed)
@ -1423,17 +1460,9 @@ extern "C" {
declarations: declarations:
RawServoDeclarationBlockBorrowed); RawServoDeclarationBlockBorrowed);
} }
extern "C" {
pub fn Servo_StyleRule_GetCssText(rule: RawServoStyleRuleBorrowed,
result: *mut nsAString_internal);
}
extern "C" { extern "C" {
pub fn Servo_StyleRule_GetSelectorText(rule: RawServoStyleRuleBorrowed, pub fn Servo_StyleRule_GetSelectorText(rule: RawServoStyleRuleBorrowed,
result: *mut nsAString_internal); result: *mut nsAString);
}
extern "C" {
pub fn Servo_MediaRule_Debug(rule: RawServoMediaRuleBorrowed,
result: *mut nsACString_internal);
} }
extern "C" { extern "C" {
pub fn Servo_MediaRule_GetMedia(rule: RawServoMediaRuleBorrowed) pub fn Servo_MediaRule_GetMedia(rule: RawServoMediaRuleBorrowed)
@ -1444,21 +1473,17 @@ extern "C" {
-> ServoCssRulesStrong; -> ServoCssRulesStrong;
} }
extern "C" { extern "C" {
pub fn Servo_MediaRule_GetCssText(rule: RawServoMediaRuleBorrowed, pub fn Servo_NamespaceRule_GetPrefix(rule: RawServoNamespaceRuleBorrowed)
result: *mut nsAString_internal); -> *mut nsIAtom;
} }
extern "C" { extern "C" {
pub fn Servo_NamespaceRule_Debug(rule: RawServoNamespaceRuleBorrowed, pub fn Servo_NamespaceRule_GetURI(rule: RawServoNamespaceRuleBorrowed)
result: *mut nsACString_internal); -> *mut nsIAtom;
} }
extern "C" { extern "C" {
pub fn Servo_NamespaceRule_GetCssText(rule: RawServoNamespaceRuleBorrowed, pub fn Servo_ParseProperty(property: *const nsACString,
result: *mut nsAString_internal); value: *const nsACString,
} base: *const nsACString,
extern "C" {
pub fn Servo_ParseProperty(property: *const nsACString_internal,
value: *const nsACString_internal,
base: *const nsACString_internal,
data: *const GeckoParserExtraData) data: *const GeckoParserExtraData)
-> RawServoDeclarationBlockStrong; -> RawServoDeclarationBlockStrong;
} }
@ -1472,6 +1497,13 @@ extern "C" {
result: result:
RawGeckoComputedKeyframeValuesListBorrowedMut); RawGeckoComputedKeyframeValuesListBorrowedMut);
} }
extern "C" {
pub fn Servo_AnimationValueMap_Push(arg1:
RawServoAnimationValueMapBorrowed,
property: nsCSSPropertyID,
value:
RawServoAnimationValueBorrowed);
}
extern "C" { extern "C" {
pub fn Servo_AnimationValues_Interpolate(from: pub fn Servo_AnimationValues_Interpolate(from:
RawServoAnimationValueBorrowed, RawServoAnimationValueBorrowed,
@ -1480,16 +1512,11 @@ extern "C" {
progress: f64) progress: f64)
-> RawServoAnimationValueStrong; -> RawServoAnimationValueStrong;
} }
extern "C" {
pub fn Servo_AnimationValues_Uncompute(value:
RawServoAnimationValueBorrowedListBorrowed)
-> RawServoDeclarationBlockStrong;
}
extern "C" { extern "C" {
pub fn Servo_AnimationValue_Serialize(value: pub fn Servo_AnimationValue_Serialize(value:
RawServoAnimationValueBorrowed, RawServoAnimationValueBorrowed,
property: nsCSSPropertyID, property: nsCSSPropertyID,
buffer: *mut nsAString_internal); buffer: *mut nsAString);
} }
extern "C" { extern "C" {
pub fn Servo_AnimationValue_GetOpacity(value: pub fn Servo_AnimationValue_GetOpacity(value:
@ -1510,8 +1537,8 @@ extern "C" {
-> bool; -> bool;
} }
extern "C" { extern "C" {
pub fn Servo_ParseStyleAttribute(data: *const nsACString_internal, pub fn Servo_ParseStyleAttribute(data: *const nsACString,
base: *const nsACString_internal, base: *const nsACString,
extraData: *const GeckoParserExtraData) extraData: *const GeckoParserExtraData)
-> RawServoDeclarationBlockStrong; -> RawServoDeclarationBlockStrong;
} }
@ -1532,14 +1559,13 @@ extern "C" {
extern "C" { extern "C" {
pub fn Servo_DeclarationBlock_GetCssText(declarations: pub fn Servo_DeclarationBlock_GetCssText(declarations:
RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockBorrowed,
result: *mut nsAString_internal); result: *mut nsAString);
} }
extern "C" { extern "C" {
pub fn Servo_DeclarationBlock_SerializeOneValue(declarations: pub fn Servo_DeclarationBlock_SerializeOneValue(declarations:
RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockBorrowed,
property: nsCSSPropertyID, property: nsCSSPropertyID,
buffer: buffer: *mut nsAString);
*mut nsAString_internal);
} }
extern "C" { extern "C" {
pub fn Servo_DeclarationBlock_Count(declarations: pub fn Servo_DeclarationBlock_Count(declarations:
@ -1550,43 +1576,37 @@ extern "C" {
pub fn Servo_DeclarationBlock_GetNthProperty(declarations: pub fn Servo_DeclarationBlock_GetNthProperty(declarations:
RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockBorrowed,
index: u32, index: u32,
result: result: *mut nsAString)
*mut nsAString_internal)
-> bool; -> bool;
} }
extern "C" { extern "C" {
pub fn Servo_DeclarationBlock_GetPropertyValue(declarations: pub fn Servo_DeclarationBlock_GetPropertyValue(declarations:
RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockBorrowed,
property: property:
*const nsACString_internal, *const nsACString,
value: value: *mut nsAString);
*mut nsAString_internal);
} }
extern "C" { extern "C" {
pub fn Servo_DeclarationBlock_GetPropertyValueById(declarations: pub fn Servo_DeclarationBlock_GetPropertyValueById(declarations:
RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockBorrowed,
property: property:
nsCSSPropertyID, nsCSSPropertyID,
value: value: *mut nsAString);
*mut nsAString_internal);
} }
extern "C" { extern "C" {
pub fn Servo_DeclarationBlock_GetPropertyIsImportant(declarations: pub fn Servo_DeclarationBlock_GetPropertyIsImportant(declarations:
RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockBorrowed,
property: property:
*const nsACString_internal) *const nsACString)
-> bool; -> bool;
} }
extern "C" { extern "C" {
pub fn Servo_DeclarationBlock_SetProperty(declarations: pub fn Servo_DeclarationBlock_SetProperty(declarations:
RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockBorrowed,
property: property: *const nsACString,
*const nsACString_internal, value: *const nsACString,
value:
*const nsACString_internal,
is_important: bool, is_important: bool,
base: base: *const nsACString,
*const nsACString_internal,
data: data:
*const GeckoParserExtraData) *const GeckoParserExtraData)
-> bool; -> bool;
@ -1595,11 +1615,9 @@ extern "C" {
pub fn Servo_DeclarationBlock_SetPropertyById(declarations: pub fn Servo_DeclarationBlock_SetPropertyById(declarations:
RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockBorrowed,
property: nsCSSPropertyID, property: nsCSSPropertyID,
value: value: *const nsACString,
*const nsACString_internal,
is_important: bool, is_important: bool,
base: base: *const nsACString,
*const nsACString_internal,
data: data:
*const GeckoParserExtraData) *const GeckoParserExtraData)
-> bool; -> bool;
@ -1607,8 +1625,7 @@ extern "C" {
extern "C" { extern "C" {
pub fn Servo_DeclarationBlock_RemoveProperty(declarations: pub fn Servo_DeclarationBlock_RemoveProperty(declarations:
RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockBorrowed,
property: property: *const nsACString);
*const nsACString_internal);
} }
extern "C" { extern "C" {
pub fn Servo_DeclarationBlock_RemovePropertyById(declarations: pub fn Servo_DeclarationBlock_RemovePropertyById(declarations:
@ -1672,8 +1689,7 @@ extern "C" {
extern "C" { extern "C" {
pub fn Servo_DeclarationBlock_SetFontFamily(declarations: pub fn Servo_DeclarationBlock_SetFontFamily(declarations:
RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockBorrowed,
value: value: *const nsAString);
*const nsAString_internal);
} }
extern "C" { extern "C" {
pub fn Servo_DeclarationBlock_SetTextDecorationColorOverride(declarations: pub fn Servo_DeclarationBlock_SetTextDecorationColorOverride(declarations:
@ -1681,38 +1697,35 @@ extern "C" {
} }
extern "C" { extern "C" {
pub fn Servo_MediaList_GetText(list: RawServoMediaListBorrowed, pub fn Servo_MediaList_GetText(list: RawServoMediaListBorrowed,
result: *mut nsAString_internal); result: *mut nsAString);
} }
extern "C" { extern "C" {
pub fn Servo_MediaList_SetText(list: RawServoMediaListBorrowed, pub fn Servo_MediaList_SetText(list: RawServoMediaListBorrowed,
text: *const nsACString_internal); text: *const nsACString);
} }
extern "C" { extern "C" {
pub fn Servo_MediaList_GetLength(list: RawServoMediaListBorrowed) -> u32; pub fn Servo_MediaList_GetLength(list: RawServoMediaListBorrowed) -> u32;
} }
extern "C" { extern "C" {
pub fn Servo_MediaList_GetMediumAt(list: RawServoMediaListBorrowed, pub fn Servo_MediaList_GetMediumAt(list: RawServoMediaListBorrowed,
index: u32, index: u32, result: *mut nsAString)
result: *mut nsAString_internal)
-> bool; -> bool;
} }
extern "C" { extern "C" {
pub fn Servo_MediaList_AppendMedium(list: RawServoMediaListBorrowed, pub fn Servo_MediaList_AppendMedium(list: RawServoMediaListBorrowed,
new_medium: new_medium: *const nsACString);
*const nsACString_internal);
} }
extern "C" { extern "C" {
pub fn Servo_MediaList_DeleteMedium(list: RawServoMediaListBorrowed, pub fn Servo_MediaList_DeleteMedium(list: RawServoMediaListBorrowed,
old_medium: old_medium: *const nsACString)
*const nsACString_internal)
-> bool; -> bool;
} }
extern "C" { extern "C" {
pub fn Servo_CSSSupports2(name: *const nsACString_internal, pub fn Servo_CSSSupports2(name: *const nsACString,
value: *const nsACString_internal) -> bool; value: *const nsACString) -> bool;
} }
extern "C" { extern "C" {
pub fn Servo_CSSSupports(cond: *const nsACString_internal) -> bool; pub fn Servo_CSSSupports(cond: *const nsACString) -> bool;
} }
extern "C" { extern "C" {
pub fn Servo_ComputedValues_GetForAnonymousBox(parent_style_or_null: pub fn Servo_ComputedValues_GetForAnonymousBox(parent_style_or_null:

File diff suppressed because it is too large Load diff

View file

@ -1444,6 +1444,192 @@ pub mod root {
pub type LinkedListElementTraits_ConstRawType<T> = *mut T; pub type LinkedListElementTraits_ConstRawType<T> = *mut T;
pub type LinkedListElementTraits_ClientType<T> = *mut T; pub type LinkedListElementTraits_ClientType<T> = *mut T;
pub type LinkedListElementTraits_ConstClientType<T> = *mut T; pub type LinkedListElementTraits_ConstClientType<T> = *mut T;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct nsStringRepr {
pub mData: *mut root::mozilla::detail::nsStringRepr_char_type,
pub mLength: root::mozilla::detail::nsStringRepr_size_type,
pub mFlags: u32,
}
pub type nsStringRepr_fallible_t = root::mozilla::fallible_t;
pub type nsStringRepr_char_type = u16;
pub type nsStringRepr_self_type =
root::mozilla::detail::nsStringRepr;
pub type nsStringRepr_base_string_type =
root::mozilla::detail::nsStringRepr_self_type;
pub type nsStringRepr_substring_type = root::nsAString;
pub type nsStringRepr_substring_tuple_type =
root::nsSubstringTuple;
pub type nsStringRepr_string_type = ::nsstring::nsStringRepr;
pub type nsStringRepr_const_iterator =
root::nsReadingIterator<u16>;
pub type nsStringRepr_iterator = root::nsWritingIterator<u16>;
pub type nsStringRepr_comparator_type = root::nsStringComparator;
pub type nsStringRepr_char_iterator =
*mut root::mozilla::detail::nsStringRepr_char_type;
pub type nsStringRepr_const_char_iterator =
*const root::mozilla::detail::nsStringRepr_char_type;
pub type nsStringRepr_index_type = u32;
pub type nsStringRepr_size_type = u32;
pub const nsStringRepr_F_NONE:
root::mozilla::detail::nsStringRepr__bindgen_ty_1 =
nsStringRepr__bindgen_ty_1::F_NONE;
pub const nsStringRepr_F_TERMINATED:
root::mozilla::detail::nsStringRepr__bindgen_ty_1 =
nsStringRepr__bindgen_ty_1::F_TERMINATED;
pub const nsStringRepr_F_VOIDED:
root::mozilla::detail::nsStringRepr__bindgen_ty_1 =
nsStringRepr__bindgen_ty_1::F_VOIDED;
pub const nsStringRepr_F_SHARED:
root::mozilla::detail::nsStringRepr__bindgen_ty_1 =
nsStringRepr__bindgen_ty_1::F_SHARED;
pub const nsStringRepr_F_OWNED:
root::mozilla::detail::nsStringRepr__bindgen_ty_1 =
nsStringRepr__bindgen_ty_1::F_OWNED;
pub const nsStringRepr_F_FIXED:
root::mozilla::detail::nsStringRepr__bindgen_ty_1 =
nsStringRepr__bindgen_ty_1::F_FIXED;
pub const nsStringRepr_F_LITERAL:
root::mozilla::detail::nsStringRepr__bindgen_ty_1 =
nsStringRepr__bindgen_ty_1::F_LITERAL;
pub const nsStringRepr_F_CLASS_FIXED:
root::mozilla::detail::nsStringRepr__bindgen_ty_1 =
nsStringRepr__bindgen_ty_1::F_CLASS_FIXED;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum nsStringRepr__bindgen_ty_1 {
F_NONE = 0,
F_TERMINATED = 1,
F_VOIDED = 2,
F_SHARED = 4,
F_OWNED = 8,
F_FIXED = 16,
F_LITERAL = 32,
F_CLASS_FIXED = 65536,
}
#[test]
fn bindgen_test_layout_nsStringRepr() {
assert_eq!(::std::mem::size_of::<nsStringRepr>() , 16usize ,
concat ! (
"Size of: " , stringify ! ( nsStringRepr ) ));
assert_eq! (::std::mem::align_of::<nsStringRepr>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( nsStringRepr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const nsStringRepr ) ) . mData as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
nsStringRepr ) , "::" , stringify ! ( mData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const nsStringRepr ) ) . mLength as
* const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
nsStringRepr ) , "::" , stringify ! ( mLength )
));
assert_eq! (unsafe {
& ( * ( 0 as * const nsStringRepr ) ) . mFlags as
* const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! (
nsStringRepr ) , "::" , stringify ! ( mFlags ) ));
}
impl Clone for nsStringRepr {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct nsCStringRepr {
pub mData: *mut root::mozilla::detail::nsCStringRepr_char_type,
pub mLength: root::mozilla::detail::nsCStringRepr_size_type,
pub mFlags: u32,
}
pub type nsCStringRepr_fallible_t = root::mozilla::fallible_t;
pub type nsCStringRepr_char_type = ::std::os::raw::c_char;
pub type nsCStringRepr_self_type =
root::mozilla::detail::nsCStringRepr;
pub type nsCStringRepr_base_string_type =
root::mozilla::detail::nsCStringRepr_self_type;
pub type nsCStringRepr_substring_type = root::nsACString;
pub type nsCStringRepr_substring_tuple_type =
root::nsCSubstringTuple;
pub type nsCStringRepr_string_type = root::nsCString;
pub type nsCStringRepr_const_iterator =
root::nsReadingIterator<::std::os::raw::c_char>;
pub type nsCStringRepr_iterator =
root::nsWritingIterator<::std::os::raw::c_char>;
pub type nsCStringRepr_comparator_type =
root::nsCStringComparator;
pub type nsCStringRepr_char_iterator =
*mut root::mozilla::detail::nsCStringRepr_char_type;
pub type nsCStringRepr_const_char_iterator =
*const root::mozilla::detail::nsCStringRepr_char_type;
pub type nsCStringRepr_index_type = u32;
pub type nsCStringRepr_size_type = u32;
pub const nsCStringRepr_F_NONE:
root::mozilla::detail::nsCStringRepr__bindgen_ty_1 =
nsCStringRepr__bindgen_ty_1::F_NONE;
pub const nsCStringRepr_F_TERMINATED:
root::mozilla::detail::nsCStringRepr__bindgen_ty_1 =
nsCStringRepr__bindgen_ty_1::F_TERMINATED;
pub const nsCStringRepr_F_VOIDED:
root::mozilla::detail::nsCStringRepr__bindgen_ty_1 =
nsCStringRepr__bindgen_ty_1::F_VOIDED;
pub const nsCStringRepr_F_SHARED:
root::mozilla::detail::nsCStringRepr__bindgen_ty_1 =
nsCStringRepr__bindgen_ty_1::F_SHARED;
pub const nsCStringRepr_F_OWNED:
root::mozilla::detail::nsCStringRepr__bindgen_ty_1 =
nsCStringRepr__bindgen_ty_1::F_OWNED;
pub const nsCStringRepr_F_FIXED:
root::mozilla::detail::nsCStringRepr__bindgen_ty_1 =
nsCStringRepr__bindgen_ty_1::F_FIXED;
pub const nsCStringRepr_F_LITERAL:
root::mozilla::detail::nsCStringRepr__bindgen_ty_1 =
nsCStringRepr__bindgen_ty_1::F_LITERAL;
pub const nsCStringRepr_F_CLASS_FIXED:
root::mozilla::detail::nsCStringRepr__bindgen_ty_1 =
nsCStringRepr__bindgen_ty_1::F_CLASS_FIXED;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum nsCStringRepr__bindgen_ty_1 {
F_NONE = 0,
F_TERMINATED = 1,
F_VOIDED = 2,
F_SHARED = 4,
F_OWNED = 8,
F_FIXED = 16,
F_LITERAL = 32,
F_CLASS_FIXED = 65536,
}
#[test]
fn bindgen_test_layout_nsCStringRepr() {
assert_eq!(::std::mem::size_of::<nsCStringRepr>() , 16usize ,
concat ! (
"Size of: " , stringify ! ( nsCStringRepr ) ));
assert_eq! (::std::mem::align_of::<nsCStringRepr>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( nsCStringRepr )
));
assert_eq! (unsafe {
& ( * ( 0 as * const nsCStringRepr ) ) . mData as
* const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
nsCStringRepr ) , "::" , stringify ! ( mData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const nsCStringRepr ) ) . mLength
as * const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
nsCStringRepr ) , "::" , stringify ! ( mLength )
));
assert_eq! (unsafe {
& ( * ( 0 as * const nsCStringRepr ) ) . mFlags as
* const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! (
nsCStringRepr ) , "::" , stringify ! ( mFlags )
));
}
impl Clone for nsCStringRepr {
fn clone(&self) -> Self { *self }
}
} }
pub type MallocSizeOf = pub type MallocSizeOf =
::std::option::Option<unsafe extern "C" fn(p: ::std::option::Option<unsafe extern "C" fn(p:
@ -1990,10 +2176,10 @@ pub mod root {
} }
#[repr(C)] #[repr(C)]
pub struct FakeString { pub struct FakeString {
pub mData: *mut root::nsAString_internal_char_type, pub mData: *mut root::mozilla::detail::nsStringRepr_char_type,
pub mLength: root::nsAString_internal_size_type, pub mLength: root::mozilla::detail::nsStringRepr_size_type,
pub mFlags: u32, pub mFlags: u32,
pub mInlineStorage: [root::nsAString_internal_char_type; 64usize], pub mInlineStorage: [root::mozilla::detail::nsStringRepr_char_type; 64usize],
} }
#[repr(C)] #[repr(C)]
#[derive(Debug)] #[derive(Debug)]
@ -2938,7 +3124,7 @@ pub mod root {
pub mPrefix: root::nsCOMPtr<root::nsIAtom>, pub mPrefix: root::nsCOMPtr<root::nsIAtom>,
pub mNamespaceID: i32, pub mNamespaceID: i32,
pub mNodeType: u16, pub mNodeType: u16,
pub mNameString: *const root::nsAString_internal, pub mNameString: *const root::nsAString,
pub mExtraName: root::nsCOMPtr<root::nsIAtom>, pub mExtraName: root::nsCOMPtr<root::nsIAtom>,
} }
#[test] #[test]
@ -4084,6 +4270,7 @@ pub mod root {
pub mRootBounds: root::RefPtr<root::mozilla::dom::DOMRect>, pub mRootBounds: root::RefPtr<root::mozilla::dom::DOMRect>,
pub mBoundingClientRect: root::RefPtr<root::mozilla::dom::DOMRect>, pub mBoundingClientRect: root::RefPtr<root::mozilla::dom::DOMRect>,
pub mIntersectionRect: root::RefPtr<root::mozilla::dom::DOMRect>, pub mIntersectionRect: root::RefPtr<root::mozilla::dom::DOMRect>,
pub mIsIntersecting: bool,
pub mTarget: root::RefPtr<root::mozilla::dom::Element>, pub mTarget: root::RefPtr<root::mozilla::dom::Element>,
pub mIntersectionRatio: f64, pub mIntersectionRatio: f64,
} }
@ -4118,7 +4305,7 @@ pub mod root {
#[test] #[test]
fn bindgen_test_layout_DOMIntersectionObserverEntry() { fn bindgen_test_layout_DOMIntersectionObserverEntry() {
assert_eq!(::std::mem::size_of::<DOMIntersectionObserverEntry>() assert_eq!(::std::mem::size_of::<DOMIntersectionObserverEntry>()
, 96usize , concat ! ( , 104usize , concat ! (
"Size of: " , stringify ! ( "Size of: " , stringify ! (
DOMIntersectionObserverEntry ) )); DOMIntersectionObserverEntry ) ));
assert_eq! (::std::mem::align_of::<DOMIntersectionObserverEntry>() assert_eq! (::std::mem::align_of::<DOMIntersectionObserverEntry>()
@ -7839,9 +8026,6 @@ pub mod root {
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct ServoAnimationRule([u8; 0]);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct AnimationPerformanceWarning([u8; 0]); pub struct AnimationPerformanceWarning([u8; 0]);
pub type CSSPseudoClassTypeBase = u8; pub type CSSPseudoClassTypeBase = u8;
#[repr(u8)] #[repr(u8)]
@ -7981,12 +8165,6 @@ pub mod root {
pub type pair_first_type<_T1> = _T1; pub type pair_first_type<_T1> = _T1;
pub type pair_second_type<_T2> = _T2; pub type pair_second_type<_T2> = _T2;
#[repr(C)] #[repr(C)]
pub struct atomic<_Tp> {
pub _base: (),
pub _phantom_0: ::std::marker::PhantomData<_Tp>,
}
pub type atomic___base = [u8; 0usize];
#[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct input_iterator_tag { pub struct input_iterator_tag {
pub _address: u8, pub _address: u8,
@ -8005,62 +8183,6 @@ pub mod root {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)]
pub struct forward_iterator_tag {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_forward_iterator_tag() {
assert_eq!(::std::mem::size_of::<forward_iterator_tag>() , 1usize
, concat ! (
"Size of: " , stringify ! ( forward_iterator_tag ) ));
assert_eq! (::std::mem::align_of::<forward_iterator_tag>() ,
1usize , concat ! (
"Alignment of " , stringify ! ( forward_iterator_tag )
));
}
impl Clone for forward_iterator_tag {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct bidirectional_iterator_tag {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_bidirectional_iterator_tag() {
assert_eq!(::std::mem::size_of::<bidirectional_iterator_tag>() ,
1usize , concat ! (
"Size of: " , stringify ! ( bidirectional_iterator_tag
) ));
assert_eq! (::std::mem::align_of::<bidirectional_iterator_tag>() ,
1usize , concat ! (
"Alignment of " , stringify ! (
bidirectional_iterator_tag ) ));
}
impl Clone for bidirectional_iterator_tag {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct random_access_iterator_tag {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_random_access_iterator_tag() {
assert_eq!(::std::mem::size_of::<random_access_iterator_tag>() ,
1usize , concat ! (
"Size of: " , stringify ! ( random_access_iterator_tag
) ));
assert_eq! (::std::mem::align_of::<random_access_iterator_tag>() ,
1usize , concat ! (
"Alignment of " , stringify ! (
random_access_iterator_tag ) ));
}
impl Clone for random_access_iterator_tag {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct iterator<_Category, _Tp, _Distance, _Pointer, _Reference> { pub struct iterator<_Category, _Tp, _Distance, _Pointer, _Reference> {
pub _address: u8, pub _address: u8,
@ -8070,22 +8192,22 @@ pub mod root {
pub _phantom_3: ::std::marker::PhantomData<_Pointer>, pub _phantom_3: ::std::marker::PhantomData<_Pointer>,
pub _phantom_4: ::std::marker::PhantomData<_Reference>, pub _phantom_4: ::std::marker::PhantomData<_Reference>,
} }
pub type iterator_iterator_category<_Category> = _Category;
pub type iterator_value_type<_Tp> = _Tp; pub type iterator_value_type<_Tp> = _Tp;
pub type iterator_difference_type<_Distance> = _Distance; pub type iterator_difference_type<_Distance> = _Distance;
pub type iterator_pointer<_Pointer> = _Pointer; pub type iterator_pointer<_Pointer> = _Pointer;
pub type iterator_reference<_Reference> = _Reference; pub type iterator_reference<_Reference> = _Reference;
pub type iterator_iterator_category<_Category> = _Category;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug)]
pub struct __bit_const_reference<_Cp> { pub struct atomic<_Tp> {
pub __seg_: root::std::__bit_const_reference___storage_pointer<_Cp>, pub _M_i: _Tp,
pub __mask_: root::std::__bit_const_reference___storage_type<_Cp>,
} }
pub type __bit_const_reference___storage_type<_Cp> = _Cp;
pub type __bit_const_reference___storage_pointer<_Cp> = _Cp;
} }
pub type __darwin_va_list = root::__builtin_va_list; pub mod __gnu_cxx {
pub type va_list = root::__darwin_va_list; #[allow(unused_imports)]
use self::super::super::root;
}
pub type va_list = root::__builtin_va_list;
/** /**
* MozRefCountType is Mozilla's reference count type. * MozRefCountType is Mozilla's reference count type.
* *
@ -9422,92 +9544,21 @@ pub mod root {
JS_GENERIC_MAGIC = 16, JS_GENERIC_MAGIC = 16,
JS_WHY_MAGIC_COUNT = 17, JS_WHY_MAGIC_COUNT = 17,
} }
/**
* double-byte (char16_t) string types
*/
#[repr(C)] #[repr(C)]
#[derive(Debug)] #[derive(Debug)]
pub struct nsAString_internal { pub struct nsAString {
pub mData: *mut root::nsAString_internal_char_type, pub _base: root::mozilla::detail::nsStringRepr,
pub mLength: root::nsAString_internal_size_type,
pub mFlags: u32,
}
pub type nsAString_internal_fallible_t = root::mozilla::fallible_t;
pub type nsAString_internal_char_type = u16;
pub type nsAString_internal_self_type = root::nsAString_internal;
pub type nsAString_internal_abstract_string_type =
root::nsAString_internal_self_type;
pub type nsAString_internal_base_string_type =
root::nsAString_internal_self_type;
pub type nsAString_internal_substring_type =
root::nsAString_internal_self_type;
pub type nsAString_internal_substring_tuple_type = root::nsSubstringTuple;
pub type nsAString_internal_string_type = ::nsstring::nsStringRepr;
pub type nsAString_internal_const_iterator = root::nsReadingIterator<u16>;
pub type nsAString_internal_iterator = root::nsWritingIterator<u16>;
pub type nsAString_internal_comparator_type = root::nsStringComparator;
pub type nsAString_internal_char_iterator =
*mut root::nsAString_internal_char_type;
pub type nsAString_internal_const_char_iterator =
*const root::nsAString_internal_char_type;
pub type nsAString_internal_size_type = u32;
pub type nsAString_internal_index_type = u32;
pub const nsAString_internal_F_NONE:
root::nsAString_internal__bindgen_ty_1 =
nsAString_internal__bindgen_ty_1::F_NONE;
pub const nsAString_internal_F_TERMINATED:
root::nsAString_internal__bindgen_ty_1 =
nsAString_internal__bindgen_ty_1::F_TERMINATED;
pub const nsAString_internal_F_VOIDED:
root::nsAString_internal__bindgen_ty_1 =
nsAString_internal__bindgen_ty_1::F_VOIDED;
pub const nsAString_internal_F_SHARED:
root::nsAString_internal__bindgen_ty_1 =
nsAString_internal__bindgen_ty_1::F_SHARED;
pub const nsAString_internal_F_OWNED:
root::nsAString_internal__bindgen_ty_1 =
nsAString_internal__bindgen_ty_1::F_OWNED;
pub const nsAString_internal_F_FIXED:
root::nsAString_internal__bindgen_ty_1 =
nsAString_internal__bindgen_ty_1::F_FIXED;
pub const nsAString_internal_F_LITERAL:
root::nsAString_internal__bindgen_ty_1 =
nsAString_internal__bindgen_ty_1::F_LITERAL;
pub const nsAString_internal_F_CLASS_FIXED:
root::nsAString_internal__bindgen_ty_1 =
nsAString_internal__bindgen_ty_1::F_CLASS_FIXED;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum nsAString_internal__bindgen_ty_1 {
F_NONE = 0,
F_TERMINATED = 1,
F_VOIDED = 2,
F_SHARED = 4,
F_OWNED = 8,
F_FIXED = 16,
F_LITERAL = 32,
F_CLASS_FIXED = 65536,
} }
pub type nsAString_self_type = root::nsAString;
#[test] #[test]
fn bindgen_test_layout_nsAString_internal() { fn bindgen_test_layout_nsAString() {
assert_eq!(::std::mem::size_of::<nsAString_internal>() , 16usize , assert_eq!(::std::mem::size_of::<nsAString>() , 16usize , concat ! (
concat ! ( "Size of: " , stringify ! ( nsAString_internal ) "Size of: " , stringify ! ( nsAString ) ));
)); assert_eq! (::std::mem::align_of::<nsAString>() , 8usize , concat ! (
assert_eq! (::std::mem::align_of::<nsAString_internal>() , 8usize , "Alignment of " , stringify ! ( nsAString ) ));
concat ! (
"Alignment of " , stringify ! ( nsAString_internal ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const nsAString_internal ) ) . mData as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( nsAString_internal
) , "::" , stringify ! ( mData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const nsAString_internal ) ) . mLength as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( nsAString_internal
) , "::" , stringify ! ( mLength ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const nsAString_internal ) ) . mFlags as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( nsAString_internal
) , "::" , stringify ! ( mFlags ) ));
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
@ -9518,8 +9569,8 @@ pub mod root {
} }
pub type nsSubstringTuple_char_type = u16; pub type nsSubstringTuple_char_type = u16;
pub type nsSubstringTuple_self_type = root::nsSubstringTuple; pub type nsSubstringTuple_self_type = root::nsSubstringTuple;
pub type nsSubstringTuple_substring_type = root::nsAString_internal; pub type nsSubstringTuple_base_string_type =
pub type nsSubstringTuple_base_string_type = root::nsAString_internal; root::mozilla::detail::nsStringRepr;
pub type nsSubstringTuple_size_type = u32; pub type nsSubstringTuple_size_type = u32;
#[test] #[test]
fn bindgen_test_layout_nsSubstringTuple() { fn bindgen_test_layout_nsSubstringTuple() {
@ -9551,7 +9602,7 @@ pub mod root {
#[repr(C)] #[repr(C)]
pub struct nsAutoString { pub struct nsAutoString {
pub _base: root::nsFixedString, pub _base: root::nsFixedString,
pub mStorage: [root::nsAString_internal_char_type; 64usize], pub mStorage: [root::mozilla::detail::nsStringRepr_char_type; 64usize],
} }
pub type nsAutoString_self_type = root::nsAutoString; pub type nsAutoString_self_type = root::nsAutoString;
pub const nsAutoString_kDefaultStorageSize: pub const nsAutoString_kDefaultStorageSize:
@ -9575,7 +9626,7 @@ pub mod root {
#[repr(C)] #[repr(C)]
#[derive(Debug)] #[derive(Debug)]
pub struct nsDependentSubstring { pub struct nsDependentSubstring {
pub _base: root::nsAString_internal, pub _base: root::nsAString,
} }
pub type nsDependentSubstring_self_type = root::nsDependentSubstring; pub type nsDependentSubstring_self_type = root::nsDependentSubstring;
#[test] #[test]
@ -9608,95 +9659,21 @@ pub mod root {
impl Clone for nsStringComparator { impl Clone for nsStringComparator {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
/**
* single-byte (char) string types
*/
#[repr(C)] #[repr(C)]
#[derive(Debug)] #[derive(Debug)]
pub struct nsACString_internal { pub struct nsACString {
pub mData: *mut root::nsACString_internal_char_type, pub _base: root::mozilla::detail::nsCStringRepr,
pub mLength: root::nsACString_internal_size_type,
pub mFlags: u32,
}
pub type nsACString_internal_fallible_t = root::mozilla::fallible_t;
pub type nsACString_internal_char_type = ::std::os::raw::c_char;
pub type nsACString_internal_self_type = root::nsACString_internal;
pub type nsACString_internal_abstract_string_type =
root::nsACString_internal_self_type;
pub type nsACString_internal_base_string_type =
root::nsACString_internal_self_type;
pub type nsACString_internal_substring_type =
root::nsACString_internal_self_type;
pub type nsACString_internal_substring_tuple_type =
root::nsCSubstringTuple;
pub type nsACString_internal_string_type = root::nsCString;
pub type nsACString_internal_const_iterator =
root::nsReadingIterator<::std::os::raw::c_char>;
pub type nsACString_internal_iterator =
root::nsWritingIterator<::std::os::raw::c_char>;
pub type nsACString_internal_comparator_type = root::nsCStringComparator;
pub type nsACString_internal_char_iterator =
*mut root::nsACString_internal_char_type;
pub type nsACString_internal_const_char_iterator =
*const root::nsACString_internal_char_type;
pub type nsACString_internal_size_type = u32;
pub type nsACString_internal_index_type = u32;
pub const nsACString_internal_F_NONE:
root::nsACString_internal__bindgen_ty_1 =
nsACString_internal__bindgen_ty_1::F_NONE;
pub const nsACString_internal_F_TERMINATED:
root::nsACString_internal__bindgen_ty_1 =
nsACString_internal__bindgen_ty_1::F_TERMINATED;
pub const nsACString_internal_F_VOIDED:
root::nsACString_internal__bindgen_ty_1 =
nsACString_internal__bindgen_ty_1::F_VOIDED;
pub const nsACString_internal_F_SHARED:
root::nsACString_internal__bindgen_ty_1 =
nsACString_internal__bindgen_ty_1::F_SHARED;
pub const nsACString_internal_F_OWNED:
root::nsACString_internal__bindgen_ty_1 =
nsACString_internal__bindgen_ty_1::F_OWNED;
pub const nsACString_internal_F_FIXED:
root::nsACString_internal__bindgen_ty_1 =
nsACString_internal__bindgen_ty_1::F_FIXED;
pub const nsACString_internal_F_LITERAL:
root::nsACString_internal__bindgen_ty_1 =
nsACString_internal__bindgen_ty_1::F_LITERAL;
pub const nsACString_internal_F_CLASS_FIXED:
root::nsACString_internal__bindgen_ty_1 =
nsACString_internal__bindgen_ty_1::F_CLASS_FIXED;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum nsACString_internal__bindgen_ty_1 {
F_NONE = 0,
F_TERMINATED = 1,
F_VOIDED = 2,
F_SHARED = 4,
F_OWNED = 8,
F_FIXED = 16,
F_LITERAL = 32,
F_CLASS_FIXED = 65536,
} }
pub type nsACString_self_type = root::nsACString;
#[test] #[test]
fn bindgen_test_layout_nsACString_internal() { fn bindgen_test_layout_nsACString() {
assert_eq!(::std::mem::size_of::<nsACString_internal>() , 16usize , assert_eq!(::std::mem::size_of::<nsACString>() , 16usize , concat ! (
concat ! ( "Size of: " , stringify ! ( nsACString ) ));
"Size of: " , stringify ! ( nsACString_internal ) )); assert_eq! (::std::mem::align_of::<nsACString>() , 8usize , concat ! (
assert_eq! (::std::mem::align_of::<nsACString_internal>() , 8usize , "Alignment of " , stringify ! ( nsACString ) ));
concat ! (
"Alignment of " , stringify ! ( nsACString_internal ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const nsACString_internal ) ) . mData as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( nsACString_internal
) , "::" , stringify ! ( mData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const nsACString_internal ) ) . mLength as
* const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( nsACString_internal
) , "::" , stringify ! ( mLength ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const nsACString_internal ) ) . mFlags as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( nsACString_internal
) , "::" , stringify ! ( mFlags ) ));
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
@ -9707,8 +9684,8 @@ pub mod root {
} }
pub type nsCSubstringTuple_char_type = ::std::os::raw::c_char; pub type nsCSubstringTuple_char_type = ::std::os::raw::c_char;
pub type nsCSubstringTuple_self_type = root::nsCSubstringTuple; pub type nsCSubstringTuple_self_type = root::nsCSubstringTuple;
pub type nsCSubstringTuple_substring_type = root::nsACString_internal; pub type nsCSubstringTuple_base_string_type =
pub type nsCSubstringTuple_base_string_type = root::nsACString_internal; root::mozilla::detail::nsCStringRepr;
pub type nsCSubstringTuple_size_type = u32; pub type nsCSubstringTuple_size_type = u32;
#[test] #[test]
fn bindgen_test_layout_nsCSubstringTuple() { fn bindgen_test_layout_nsCSubstringTuple() {
@ -9740,7 +9717,7 @@ pub mod root {
#[repr(C)] #[repr(C)]
#[derive(Debug)] #[derive(Debug)]
pub struct nsCString { pub struct nsCString {
pub _base: root::nsACString_internal, pub _base: root::nsACString,
} }
pub type nsCString_self_type = root::nsCString; pub type nsCString_self_type = root::nsCString;
#[repr(C)] #[repr(C)]
@ -9781,7 +9758,7 @@ pub mod root {
#[repr(C)] #[repr(C)]
#[derive(Debug)] #[derive(Debug)]
pub struct nsDependentCSubstring { pub struct nsDependentCSubstring {
pub _base: root::nsACString_internal, pub _base: root::nsACString,
} }
pub type nsDependentCSubstring_self_type = root::nsDependentCSubstring; pub type nsDependentCSubstring_self_type = root::nsDependentCSubstring;
#[test] #[test]
@ -9818,7 +9795,7 @@ pub mod root {
/** /**
* typedefs for backwards compatibility * typedefs for backwards compatibility
*/ */
pub type nsSubstring = root::nsAString_internal; pub type nsSubstring = root::nsAString;
pub type nsAFlatCString = root::nsCString; pub type nsAFlatCString = root::nsCString;
#[repr(C)] #[repr(C)]
pub struct nsISupports__bindgen_vtable { pub struct nsISupports__bindgen_vtable {
@ -9954,16 +9931,16 @@ pub mod root {
#[repr(C)] #[repr(C)]
#[derive(Debug)] #[derive(Debug)]
pub struct nsSubstringSplitter { pub struct nsSubstringSplitter {
pub mStr: *const root::nsAString_internal, pub mStr: *const root::nsAString,
pub mArray: root::mozilla::UniquePtr<[root::nsDependentSubstring; 0usize], pub mArray: root::mozilla::UniquePtr<[root::nsDependentSubstring; 0usize],
root::mozilla::DefaultDelete<[root::nsDependentSubstring; 0usize]>>, root::mozilla::DefaultDelete<[root::nsDependentSubstring; 0usize]>>,
pub mArraySize: root::nsSubstringSplitter_size_type, pub mArraySize: root::nsSubstringSplitter_size_type,
pub mDelim: root::nsSubstringSplitter_char_type, pub mDelim: root::nsSubstringSplitter_char_type,
} }
pub type nsSubstringSplitter_size_type = pub type nsSubstringSplitter_size_type =
root::nsAString_internal_size_type; root::mozilla::detail::nsStringRepr_size_type;
pub type nsSubstringSplitter_char_type = pub type nsSubstringSplitter_char_type =
root::nsAString_internal_char_type; root::mozilla::detail::nsStringRepr_char_type;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsSubstringSplitter_nsTSubstringSplit_Iter { pub struct nsSubstringSplitter_nsTSubstringSplit_Iter {
@ -10032,16 +10009,16 @@ pub mod root {
#[repr(C)] #[repr(C)]
#[derive(Debug)] #[derive(Debug)]
pub struct nsCSubstringSplitter { pub struct nsCSubstringSplitter {
pub mStr: *const root::nsACString_internal, pub mStr: *const root::nsACString,
pub mArray: root::mozilla::UniquePtr<[root::nsDependentCSubstring; 0usize], pub mArray: root::mozilla::UniquePtr<[root::nsDependentCSubstring; 0usize],
root::mozilla::DefaultDelete<[root::nsDependentCSubstring; 0usize]>>, root::mozilla::DefaultDelete<[root::nsDependentCSubstring; 0usize]>>,
pub mArraySize: root::nsCSubstringSplitter_size_type, pub mArraySize: root::nsCSubstringSplitter_size_type,
pub mDelim: root::nsCSubstringSplitter_char_type, pub mDelim: root::nsCSubstringSplitter_char_type,
} }
pub type nsCSubstringSplitter_size_type = pub type nsCSubstringSplitter_size_type =
root::nsACString_internal_size_type; root::mozilla::detail::nsCStringRepr_size_type;
pub type nsCSubstringSplitter_char_type = pub type nsCSubstringSplitter_char_type =
root::nsACString_internal_char_type; root::mozilla::detail::nsCStringRepr_char_type;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsCSubstringSplitter_nsTSubstringSplit_Iter { pub struct nsCSubstringSplitter_nsTSubstringSplit_Iter {
@ -10112,8 +10089,8 @@ pub mod root {
#[derive(Debug)] #[derive(Debug)]
pub struct nsFixedString { pub struct nsFixedString {
pub _base: ::nsstring::nsStringRepr, pub _base: ::nsstring::nsStringRepr,
pub mFixedCapacity: root::nsAString_internal_size_type, pub mFixedCapacity: root::mozilla::detail::nsStringRepr_size_type,
pub mFixedBuf: *mut root::nsAString_internal_char_type, pub mFixedBuf: *mut root::mozilla::detail::nsStringRepr_char_type,
} }
pub type nsFixedString_self_type = root::nsFixedString; pub type nsFixedString_self_type = root::nsFixedString;
pub type nsFixedString_fixed_string_type = root::nsFixedString; pub type nsFixedString_fixed_string_type = root::nsFixedString;
@ -15088,63 +15065,63 @@ pub mod root {
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct nsDOMMutationObserver([u8; 0]); pub struct nsDOMMutationObserver([u8; 0]);
pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_28 = pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_HAS_LISTENERMANAGER; _bindgen_ty_105::NODE_HAS_LISTENERMANAGER;
pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_28 = pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_HAS_PROPERTIES; _bindgen_ty_105::NODE_HAS_PROPERTIES;
pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_28 = pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_IS_ANONYMOUS_ROOT; _bindgen_ty_105::NODE_IS_ANONYMOUS_ROOT;
pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_28 = pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; _bindgen_ty_105::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE;
pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_28 = pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_IS_NATIVE_ANONYMOUS_ROOT; _bindgen_ty_105::NODE_IS_NATIVE_ANONYMOUS_ROOT;
pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_28 = pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_FORCE_XBL_BINDINGS; _bindgen_ty_105::NODE_FORCE_XBL_BINDINGS;
pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_28 = pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_MAY_BE_IN_BINDING_MNGR; _bindgen_ty_105::NODE_MAY_BE_IN_BINDING_MNGR;
pub const NODE_IS_EDITABLE: root::_bindgen_ty_28 = pub const NODE_IS_EDITABLE: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_IS_EDITABLE; _bindgen_ty_105::NODE_IS_EDITABLE;
pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_28 = pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_IS_NATIVE_ANONYMOUS; _bindgen_ty_105::NODE_IS_NATIVE_ANONYMOUS;
pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_28 = pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_IS_IN_SHADOW_TREE; _bindgen_ty_105::NODE_IS_IN_SHADOW_TREE;
pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_28 = pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_HAS_EMPTY_SELECTOR; _bindgen_ty_105::NODE_HAS_EMPTY_SELECTOR;
pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_28 = pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_HAS_SLOW_SELECTOR; _bindgen_ty_105::NODE_HAS_SLOW_SELECTOR;
pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_28 = pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_HAS_EDGE_CHILD_SELECTOR; _bindgen_ty_105::NODE_HAS_EDGE_CHILD_SELECTOR;
pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_28 = pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; _bindgen_ty_105::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS;
pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_28 = pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_ALL_SELECTOR_FLAGS; _bindgen_ty_105::NODE_ALL_SELECTOR_FLAGS;
pub const NODE_NEEDS_FRAME: root::_bindgen_ty_28 = pub const NODE_NEEDS_FRAME: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_NEEDS_FRAME; _bindgen_ty_105::NODE_NEEDS_FRAME;
pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_28 = pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_DESCENDANTS_NEED_FRAMES; _bindgen_ty_105::NODE_DESCENDANTS_NEED_FRAMES;
pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_28 = pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_HAS_ACCESSKEY; _bindgen_ty_105::NODE_HAS_ACCESSKEY;
pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_28 = pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_HAS_DIRECTION_RTL; _bindgen_ty_105::NODE_HAS_DIRECTION_RTL;
pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_28 = pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_HAS_DIRECTION_LTR; _bindgen_ty_105::NODE_HAS_DIRECTION_LTR;
pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_28 = pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_ALL_DIRECTION_FLAGS; _bindgen_ty_105::NODE_ALL_DIRECTION_FLAGS;
pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_28 = pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_CHROME_ONLY_ACCESS; _bindgen_ty_105::NODE_CHROME_ONLY_ACCESS;
pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_28 = pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; _bindgen_ty_105::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS;
pub const NODE_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_28 = pub const NODE_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_SHARED_RESTYLE_BIT_1; _bindgen_ty_105::NODE_SHARED_RESTYLE_BIT_1;
pub const NODE_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_28 = pub const NODE_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_SHARED_RESTYLE_BIT_2; _bindgen_ty_105::NODE_SHARED_RESTYLE_BIT_2;
pub const NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_28 = pub const NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_SHARED_RESTYLE_BIT_1; _bindgen_ty_105::NODE_SHARED_RESTYLE_BIT_1;
pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_28 = pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_105 =
_bindgen_ty_28::NODE_TYPE_SPECIFIC_BITS_OFFSET; _bindgen_ty_105::NODE_TYPE_SPECIFIC_BITS_OFFSET;
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum _bindgen_ty_28 { pub enum _bindgen_ty_105 {
NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_LISTENERMANAGER = 4,
NODE_HAS_PROPERTIES = 8, NODE_HAS_PROPERTIES = 8,
NODE_IS_ANONYMOUS_ROOT = 16, NODE_IS_ANONYMOUS_ROOT = 16,
@ -25217,10 +25194,13 @@ pub mod root {
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct RawServoStyleSet([u8; 0]);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct RawServoAnimationValue([u8; 0]); pub struct RawServoAnimationValue([u8; 0]);
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct RawServoStyleSet([u8; 0]); pub struct RawServoAnimationValueMap([u8; 0]);
pub type RawGeckoNode = root::nsINode; pub type RawGeckoNode = root::nsINode;
pub type RawGeckoElement = root::mozilla::dom::Element; pub type RawGeckoElement = root::mozilla::dom::Element;
pub type RawGeckoDocument = root::nsIDocument; pub type RawGeckoDocument = root::nsIDocument;
@ -25230,10 +25210,10 @@ pub mod root {
root::nsTArray<root::nsTArray<root::mozilla::PropertyStyleAnimationValuePair>>; root::nsTArray<root::nsTArray<root::mozilla::PropertyStyleAnimationValuePair>>;
pub type RawGeckoAnimationValueList = pub type RawGeckoAnimationValueList =
root::nsTArray<root::mozilla::PropertyStyleAnimationValuePair>; root::nsTArray<root::mozilla::PropertyStyleAnimationValuePair>;
pub type RawServoAnimationValueBorrowedList =
root::nsTArray<*const root::RawServoAnimationValue>;
pub type RawGeckoStyleAnimationList = pub type RawGeckoStyleAnimationList =
root::nsStyleAutoArray<root::mozilla::StyleAnimation>; root::nsStyleAutoArray<root::mozilla::StyleAnimation>;
pub type RawServoAnimationValueMapBorrowed =
*const root::RawServoAnimationValueMap;
pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode; pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode;
pub type RawGeckoNodeBorrowedOrNull = *const root::RawGeckoNode; pub type RawGeckoNodeBorrowedOrNull = *const root::RawGeckoNode;
pub type RawGeckoElementBorrowed = *const root::RawGeckoElement; pub type RawGeckoElementBorrowed = *const root::RawGeckoElement;
@ -25245,8 +25225,6 @@ pub mod root {
pub type RawGeckoPresContextBorrowedMut = *mut root::RawGeckoPresContext; pub type RawGeckoPresContextBorrowedMut = *mut root::RawGeckoPresContext;
pub type RawGeckoAnimationValueListBorrowedMut = pub type RawGeckoAnimationValueListBorrowedMut =
*mut root::RawGeckoAnimationValueList; *mut root::RawGeckoAnimationValueList;
pub type RawServoAnimationValueBorrowedListBorrowed =
*const root::RawServoAnimationValueBorrowedList;
pub type RawGeckoKeyframeListBorrowedMut = pub type RawGeckoKeyframeListBorrowedMut =
*mut root::RawGeckoKeyframeList; *mut root::RawGeckoKeyframeList;
pub type RawGeckoKeyframeListBorrowed = *const root::RawGeckoKeyframeList; pub type RawGeckoKeyframeListBorrowed = *const root::RawGeckoKeyframeList;

View file

@ -14,7 +14,7 @@ use cache::{LRUCache, LRUCacheMutIterator};
use cascade_info::CascadeInfo; use cascade_info::CascadeInfo;
use context::{SequentialTask, SharedStyleContext, StyleContext}; use context::{SequentialTask, SharedStyleContext, StyleContext};
use data::{ComputedStyle, ElementData, ElementStyles, RestyleData}; use data::{ComputedStyle, ElementData, ElementStyles, RestyleData};
use dom::{SendElement, TElement, TNode}; use dom::{AnimationRules, SendElement, TElement, TNode};
use properties::{CascadeFlags, ComputedValues, SHAREABLE, SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP, cascade}; use properties::{CascadeFlags, ComputedValues, SHAREABLE, SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP, cascade};
use properties::longhands::display::computed_value as display; use properties::longhands::display::computed_value as display;
use restyle_hints::{RESTYLE_STYLE_ATTRIBUTE, RestyleHint}; use restyle_hints::{RESTYLE_STYLE_ATTRIBUTE, RestyleHint};
@ -800,7 +800,11 @@ pub trait MatchMethods : TElement {
SelectorImpl::each_eagerly_cascaded_pseudo_element(|pseudo| { SelectorImpl::each_eagerly_cascaded_pseudo_element(|pseudo| {
let mut per_pseudo = &mut data.styles_mut().pseudos; let mut per_pseudo = &mut data.styles_mut().pseudos;
debug_assert!(applicable_declarations.is_empty()); debug_assert!(applicable_declarations.is_empty());
let pseudo_animation_rules = self.get_animation_rules(Some(&pseudo)); let pseudo_animation_rules = if <Self as MatchAttr>::Impl::pseudo_is_before_or_after(&pseudo) {
self.get_animation_rules(Some(&pseudo))
} else {
AnimationRules(None, None)
};
stylist.push_applicable_declarations(self, stylist.push_applicable_declarations(self,
Some(context.thread_local.bloom_filter.filter()), Some(context.thread_local.bloom_filter.filter()),
None, pseudo_animation_rules, None, pseudo_animation_rules,

View file

@ -15,6 +15,7 @@ use std::fmt;
use style_traits::ToCss; use style_traits::ToCss;
use stylesheets::Origin; use stylesheets::Origin;
use super::*; use super::*;
#[cfg(feature = "gecko")] use properties::animated_properties::AnimationValueMap;
/// A declaration [importance][importance]. /// A declaration [importance][importance].
/// ///
@ -341,6 +342,24 @@ impl PropertyDeclarationBlock {
} }
} }
} }
/// Convert AnimationValueMap to PropertyDeclarationBlock.
#[cfg(feature = "gecko")]
pub fn from_animation_value_map(animation_value_map: &AnimationValueMap) -> Self {
let mut declarations = vec![];
let mut longhands = LonghandIdSet::new();
for (property, animation_value) in animation_value_map.iter() {
longhands.set_transition_property_bit(property);
declarations.push((animation_value.uncompute(), Importance::Normal));
}
PropertyDeclarationBlock {
declarations: declarations,
important_count: 0,
longhands: longhands,
}
}
} }
impl ToCss for PropertyDeclarationBlock { impl ToCss for PropertyDeclarationBlock {

View file

@ -25,6 +25,7 @@ use properties::longhands::visibility::computed_value::T as Visibility;
use properties::longhands::z_index::computed_value::T as ZIndex; use properties::longhands::z_index::computed_value::T as ZIndex;
#[cfg(feature = "gecko")] use properties::{PropertyDeclarationId, LonghandId}; #[cfg(feature = "gecko")] use properties::{PropertyDeclarationId, LonghandId};
use std::cmp; use std::cmp;
#[cfg(feature = "gecko")] use std::collections::HashMap;
use std::fmt; use std::fmt;
use style_traits::ToCss; use style_traits::ToCss;
use super::ComputedValues; use super::ComputedValues;
@ -252,6 +253,12 @@ impl AnimatedProperty {
} }
} }
/// A collection of AnimationValue that were composed on an element.
/// This HashMap stores the values that are the last AnimationValue to be
/// composed for each TransitionProperty.
#[cfg(feature = "gecko")]
pub type AnimationValueMap = HashMap<TransitionProperty, AnimationValue>;
/// An enum to represent a single computed value belonging to an animated /// An enum to represent a single computed value belonging to an animated
/// property in order to be interpolated with another one. When interpolating, /// property in order to be interpolated with another one. When interpolating,
/// both values need to belong to the same property. /// both values need to belong to the same property.

View file

@ -45,6 +45,7 @@ use style::gecko_bindings::bindings::Gecko_AnimationAppendKeyframe;
use style::gecko_bindings::bindings::RawGeckoComputedKeyframeValuesListBorrowedMut; use style::gecko_bindings::bindings::RawGeckoComputedKeyframeValuesListBorrowedMut;
use style::gecko_bindings::bindings::RawGeckoElementBorrowed; use style::gecko_bindings::bindings::RawGeckoElementBorrowed;
use style::gecko_bindings::bindings::RawServoAnimationValueBorrowed; use style::gecko_bindings::bindings::RawServoAnimationValueBorrowed;
use style::gecko_bindings::bindings::RawServoAnimationValueMapBorrowed;
use style::gecko_bindings::bindings::RawServoAnimationValueStrong; use style::gecko_bindings::bindings::RawServoAnimationValueStrong;
use style::gecko_bindings::bindings::RawServoImportRuleBorrowed; use style::gecko_bindings::bindings::RawServoImportRuleBorrowed;
use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull; use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull;
@ -55,7 +56,6 @@ use style::gecko_bindings::structs::{ThreadSafePrincipalHolder, ThreadSafeURIHol
use style::gecko_bindings::structs::{nsRestyleHint, nsChangeHint}; use style::gecko_bindings::structs::{nsRestyleHint, nsChangeHint};
use style::gecko_bindings::structs::Loader; use style::gecko_bindings::structs::Loader;
use style::gecko_bindings::structs::RawGeckoPresContextOwned; use style::gecko_bindings::structs::RawGeckoPresContextOwned;
use style::gecko_bindings::structs::RawServoAnimationValueBorrowedListBorrowed;
use style::gecko_bindings::structs::ServoStyleSheet; use style::gecko_bindings::structs::ServoStyleSheet;
use style::gecko_bindings::structs::nsCSSValueSharedList; use style::gecko_bindings::structs::nsCSSValueSharedList;
use style::gecko_bindings::structs::nsTimingFunction; use style::gecko_bindings::structs::nsTimingFunction;
@ -248,17 +248,15 @@ pub extern "C" fn Servo_AnimationValues_Interpolate(from: RawServoAnimationValue
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn Servo_AnimationValues_Uncompute(value: RawServoAnimationValueBorrowedListBorrowed) pub extern "C" fn Servo_AnimationValueMap_Push(value_map: RawServoAnimationValueMapBorrowed,
-> RawServoDeclarationBlockStrong property: nsCSSPropertyID,
value: RawServoAnimationValueBorrowed)
{ {
let value = unsafe { value.as_ref().unwrap() }; use style::properties::animated_properties::AnimationValueMap;
let mut block = PropertyDeclarationBlock::new();
for v in value.iter() { let value_map = RwLock::<AnimationValueMap>::as_arc(&value_map);
let raw_anim = unsafe { v.as_ref().unwrap() }; let value = AnimationValue::as_arc(&value).as_ref();
let anim = AnimationValue::as_arc(&raw_anim); value_map.write().insert(property.into(), value.clone());
block.push(anim.uncompute(), Importance::Normal);
}
Arc::new(RwLock::new(block)).into_strong()
} }
macro_rules! get_property_id_from_nscsspropertyid { macro_rules! get_property_id_from_nscsspropertyid {