From bcdd1c1739d0a0ef76140c6292e273e214a9d68c Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Fri, 17 Mar 2017 12:26:25 +0900 Subject: [PATCH 1/7] binding-update --- components/style/gecko_bindings/bindings.rs | 160 ++- .../style/gecko_bindings/structs_debug.rs | 969 +++++++++--------- .../style/gecko_bindings/structs_release.rs | 610 ++++++----- 3 files changed, 869 insertions(+), 870 deletions(-) diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs index 0859b42a943..1c0114737e7 100644 --- a/components/style/gecko_bindings/bindings.rs +++ b/components/style/gecko_bindings/bindings.rs @@ -4,11 +4,6 @@ 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; -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; @@ -222,6 +217,11 @@ pub type RawServoMediaRuleBorrowed<'a> = &'a RawServoMediaRule; pub type RawServoMediaRuleBorrowedOrNull<'a> = Option<&'a RawServoMediaRule>; enum RawServoMediaRuleVoid { } pub struct RawServoMediaRule(RawServoMediaRuleVoid); +pub type RawServoNamespaceRuleStrong = ::gecko_bindings::sugar::ownership::Strong; +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; pub type RawServoStyleSetOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull; pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet; @@ -337,6 +337,12 @@ extern "C" { extern "C" { 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" { pub fn Servo_StyleSet_Drop(ptr: RawServoStyleSetOwned); } @@ -1296,10 +1302,9 @@ extern "C" { pub fn Servo_StyleSheet_FromUTF8Bytes(loader: *mut Loader, gecko_stylesheet: *mut ServoStyleSheet, - data: *const nsACString_internal, + data: *const nsACString, parsing_mode: SheetParsingMode, - base_url: - *const nsACString_internal, + base_url: *const nsACString, base: *mut ThreadSafeURIHolder, referrer: *mut ThreadSafeURIHolder, principal: @@ -1316,7 +1321,7 @@ extern "C" { loader: *mut Loader, gecko_stylesheet: *mut ServoStyleSheet, - data: *const nsACString_internal, + data: *const nsACString, base: *mut ThreadSafeURIHolder, referrer: *mut ThreadSafeURIHolder, principal: @@ -1370,8 +1375,7 @@ extern "C" { } extern "C" { pub fn Servo_StyleSet_FillKeyframesForName(set: RawServoStyleSetBorrowed, - property: - *const nsACString_internal, + property: *const nsACString, timing_function: *const nsTimingFunction, computed_values: @@ -1384,35 +1388,55 @@ extern "C" { pub fn Servo_CssRules_ListTypes(rules: ServoCssRulesBorrowed, 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" { pub fn Servo_CssRules_GetStyleRuleAt(rules: ServoCssRulesBorrowed, index: u32) -> 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" { pub fn Servo_CssRules_GetMediaRuleAt(rules: ServoCssRulesBorrowed, index: u32) -> 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" { pub fn Servo_CssRules_GetNamespaceRuleAt(rules: ServoCssRulesBorrowed, index: u32) -> RawServoNamespaceRuleStrong; } extern "C" { - pub fn Servo_CssRules_InsertRule(rules: ServoCssRulesBorrowed, - sheet: RawServoStyleSheetBorrowed, - rule: *const nsACString_internal, - index: u32, nested: bool, - rule_type: *mut u16) -> nsresult; + pub fn Servo_NamespaceRule_Debug(rule: RawServoNamespaceRuleBorrowed, + result: *mut nsACString); } extern "C" { - pub fn Servo_CssRules_DeleteRule(rules: ServoCssRulesBorrowed, index: u32) - -> nsresult; -} -extern "C" { - pub fn Servo_StyleRule_Debug(rule: RawServoStyleRuleBorrowed, - result: *mut nsACString_internal); + pub fn Servo_NamespaceRule_GetCssText(rule: RawServoNamespaceRuleBorrowed, + result: *mut nsAString); } extern "C" { pub fn Servo_StyleRule_GetStyle(rule: RawServoStyleRuleBorrowed) @@ -1423,17 +1447,9 @@ extern "C" { declarations: RawServoDeclarationBlockBorrowed); } -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_MediaRule_Debug(rule: RawServoMediaRuleBorrowed, - result: *mut nsACString_internal); + result: *mut nsAString); } extern "C" { pub fn Servo_MediaRule_GetMedia(rule: RawServoMediaRuleBorrowed) @@ -1444,21 +1460,17 @@ extern "C" { -> ServoCssRulesStrong; } extern "C" { - pub fn Servo_MediaRule_GetCssText(rule: RawServoMediaRuleBorrowed, - result: *mut nsAString_internal); + pub fn Servo_NamespaceRule_GetPrefix(rule: RawServoNamespaceRuleBorrowed) + -> *mut nsIAtom; } extern "C" { - pub fn Servo_NamespaceRule_Debug(rule: RawServoNamespaceRuleBorrowed, - result: *mut nsACString_internal); + pub fn Servo_NamespaceRule_GetURI(rule: RawServoNamespaceRuleBorrowed) + -> *mut nsIAtom; } 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, - base: *const nsACString_internal, + pub fn Servo_ParseProperty(property: *const nsACString, + value: *const nsACString, + base: *const nsACString, data: *const GeckoParserExtraData) -> RawServoDeclarationBlockStrong; } @@ -1489,7 +1501,7 @@ extern "C" { pub fn Servo_AnimationValue_Serialize(value: RawServoAnimationValueBorrowed, property: nsCSSPropertyID, - buffer: *mut nsAString_internal); + buffer: *mut nsAString); } extern "C" { pub fn Servo_AnimationValue_GetOpacity(value: @@ -1510,8 +1522,8 @@ extern "C" { -> bool; } extern "C" { - pub fn Servo_ParseStyleAttribute(data: *const nsACString_internal, - base: *const nsACString_internal, + pub fn Servo_ParseStyleAttribute(data: *const nsACString, + base: *const nsACString, extraData: *const GeckoParserExtraData) -> RawServoDeclarationBlockStrong; } @@ -1532,14 +1544,13 @@ extern "C" { extern "C" { pub fn Servo_DeclarationBlock_GetCssText(declarations: RawServoDeclarationBlockBorrowed, - result: *mut nsAString_internal); + result: *mut nsAString); } extern "C" { pub fn Servo_DeclarationBlock_SerializeOneValue(declarations: RawServoDeclarationBlockBorrowed, property: nsCSSPropertyID, - buffer: - *mut nsAString_internal); + buffer: *mut nsAString); } extern "C" { pub fn Servo_DeclarationBlock_Count(declarations: @@ -1550,43 +1561,37 @@ extern "C" { pub fn Servo_DeclarationBlock_GetNthProperty(declarations: RawServoDeclarationBlockBorrowed, index: u32, - result: - *mut nsAString_internal) + result: *mut nsAString) -> bool; } extern "C" { pub fn Servo_DeclarationBlock_GetPropertyValue(declarations: RawServoDeclarationBlockBorrowed, property: - *const nsACString_internal, - value: - *mut nsAString_internal); + *const nsACString, + value: *mut nsAString); } extern "C" { pub fn Servo_DeclarationBlock_GetPropertyValueById(declarations: RawServoDeclarationBlockBorrowed, property: nsCSSPropertyID, - value: - *mut nsAString_internal); + value: *mut nsAString); } extern "C" { pub fn Servo_DeclarationBlock_GetPropertyIsImportant(declarations: RawServoDeclarationBlockBorrowed, property: - *const nsACString_internal) + *const nsACString) -> bool; } extern "C" { pub fn Servo_DeclarationBlock_SetProperty(declarations: RawServoDeclarationBlockBorrowed, - property: - *const nsACString_internal, - value: - *const nsACString_internal, + property: *const nsACString, + value: *const nsACString, is_important: bool, - base: - *const nsACString_internal, + base: *const nsACString, data: *const GeckoParserExtraData) -> bool; @@ -1595,11 +1600,9 @@ extern "C" { pub fn Servo_DeclarationBlock_SetPropertyById(declarations: RawServoDeclarationBlockBorrowed, property: nsCSSPropertyID, - value: - *const nsACString_internal, + value: *const nsACString, is_important: bool, - base: - *const nsACString_internal, + base: *const nsACString, data: *const GeckoParserExtraData) -> bool; @@ -1607,8 +1610,7 @@ extern "C" { extern "C" { pub fn Servo_DeclarationBlock_RemoveProperty(declarations: RawServoDeclarationBlockBorrowed, - property: - *const nsACString_internal); + property: *const nsACString); } extern "C" { pub fn Servo_DeclarationBlock_RemovePropertyById(declarations: @@ -1672,8 +1674,7 @@ extern "C" { extern "C" { pub fn Servo_DeclarationBlock_SetFontFamily(declarations: RawServoDeclarationBlockBorrowed, - value: - *const nsAString_internal); + value: *const nsAString); } extern "C" { pub fn Servo_DeclarationBlock_SetTextDecorationColorOverride(declarations: @@ -1681,38 +1682,35 @@ extern "C" { } extern "C" { pub fn Servo_MediaList_GetText(list: RawServoMediaListBorrowed, - result: *mut nsAString_internal); + result: *mut nsAString); } extern "C" { pub fn Servo_MediaList_SetText(list: RawServoMediaListBorrowed, - text: *const nsACString_internal); + text: *const nsACString); } extern "C" { pub fn Servo_MediaList_GetLength(list: RawServoMediaListBorrowed) -> u32; } extern "C" { pub fn Servo_MediaList_GetMediumAt(list: RawServoMediaListBorrowed, - index: u32, - result: *mut nsAString_internal) + index: u32, result: *mut nsAString) -> bool; } extern "C" { pub fn Servo_MediaList_AppendMedium(list: RawServoMediaListBorrowed, - new_medium: - *const nsACString_internal); + new_medium: *const nsACString); } extern "C" { pub fn Servo_MediaList_DeleteMedium(list: RawServoMediaListBorrowed, - old_medium: - *const nsACString_internal) + old_medium: *const nsACString) -> bool; } extern "C" { - pub fn Servo_CSSSupports2(name: *const nsACString_internal, - value: *const nsACString_internal) -> bool; + pub fn Servo_CSSSupports2(name: *const nsACString, + value: *const nsACString) -> bool; } extern "C" { - pub fn Servo_CSSSupports(cond: *const nsACString_internal) -> bool; + pub fn Servo_CSSSupports(cond: *const nsACString) -> bool; } extern "C" { pub fn Servo_ComputedValues_GetForAnonymousBox(parent_style_or_null: diff --git a/components/style/gecko_bindings/structs_debug.rs b/components/style/gecko_bindings/structs_debug.rs index a91037fa567..b7441315898 100644 --- a/components/style/gecko_bindings/structs_debug.rs +++ b/components/style/gecko_bindings/structs_debug.rs @@ -1444,6 +1444,192 @@ pub mod root { pub type LinkedListElementTraits_ConstRawType = *mut T; pub type LinkedListElementTraits_ClientType = *mut T; pub type LinkedListElementTraits_ConstClientType = *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; + pub type nsStringRepr_iterator = root::nsWritingIterator; + 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::() , 16usize , + concat ! ( + "Size of: " , stringify ! ( nsStringRepr ) )); + assert_eq! (::std::mem::align_of::() , 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::() , 16usize , + concat ! ( + "Size of: " , stringify ! ( nsCStringRepr ) )); + assert_eq! (::std::mem::align_of::() , 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 = ::std::option::Option, pub mNamespaceID: i32, pub mNodeType: u16, - pub mNameString: *const root::nsAString_internal, + pub mNameString: *const root::nsAString, pub mExtraName: root::nsCOMPtr, } #[test] @@ -4113,6 +4299,7 @@ pub mod root { pub mRootBounds: root::RefPtr, pub mBoundingClientRect: root::RefPtr, pub mIntersectionRect: root::RefPtr, + pub mIsIntersecting: bool, pub mTarget: root::RefPtr, pub mIntersectionRatio: f64, } @@ -4147,7 +4334,7 @@ pub mod root { #[test] fn bindgen_test_layout_DOMIntersectionObserverEntry() { assert_eq!(::std::mem::size_of::() - , 104usize , concat ! ( + , 112usize , concat ! ( "Size of: " , stringify ! ( DOMIntersectionObserverEntry ) )); assert_eq! (::std::mem::align_of::() @@ -8169,12 +8356,6 @@ pub mod root { pub type pair_first_type<_T1> = _T1; pub type pair_second_type<_T2> = _T2; #[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)] pub struct input_iterator_tag { pub _address: u8, @@ -8193,62 +8374,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[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::() , 1usize - , concat ! ( - "Size of: " , stringify ! ( forward_iterator_tag ) )); - assert_eq! (::std::mem::align_of::() , - 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::() , - 1usize , concat ! ( - "Size of: " , stringify ! ( bidirectional_iterator_tag - ) )); - assert_eq! (::std::mem::align_of::() , - 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::() , - 1usize , concat ! ( - "Size of: " , stringify ! ( random_access_iterator_tag - ) )); - assert_eq! (::std::mem::align_of::() , - 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)] pub struct iterator<_Category, _Tp, _Distance, _Pointer, _Reference> { pub _address: u8, @@ -8258,209 +8383,250 @@ pub mod root { pub _phantom_3: ::std::marker::PhantomData<_Pointer>, pub _phantom_4: ::std::marker::PhantomData<_Reference>, } + pub type iterator_iterator_category<_Category> = _Category; pub type iterator_value_type<_Tp> = _Tp; pub type iterator_difference_type<_Distance> = _Distance; pub type iterator_pointer<_Pointer> = _Pointer; pub type iterator_reference<_Reference> = _Reference; - pub type iterator_iterator_category<_Category> = _Category; #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct __bit_const_reference<_Cp> { - pub __seg_: root::std::__bit_const_reference___storage_pointer<_Cp>, - pub __mask_: root::std::__bit_const_reference___storage_type<_Cp>, + #[derive(Debug)] + pub struct atomic<_Tp> { + pub _M_i: _Tp, + } + pub mod chrono { + #[allow(unused_imports)] + use self::super::super::super::root; } - pub type __bit_const_reference___storage_type<_Cp> = _Cp; - pub type __bit_const_reference___storage_pointer<_Cp> = _Cp; } - pub type __int64_t = ::std::os::raw::c_longlong; - pub type __darwin_va_list = root::__builtin_va_list; - pub type __darwin_off_t = root::__int64_t; - pub type va_list = root::__darwin_va_list; - pub type fpos_t = root::__darwin_off_t; + pub mod __gnu_cxx { + #[allow(unused_imports)] + use self::super::super::root; + } + pub type __off_t = ::std::os::raw::c_long; + pub type __off64_t = ::std::os::raw::c_long; #[repr(C)] #[derive(Debug, Copy)] - pub struct __sbuf { - pub _base: *mut ::std::os::raw::c_uchar, - pub _size: ::std::os::raw::c_int, + pub struct _IO_FILE { + pub _flags: ::std::os::raw::c_int, + pub _IO_read_ptr: *mut ::std::os::raw::c_char, + pub _IO_read_end: *mut ::std::os::raw::c_char, + pub _IO_read_base: *mut ::std::os::raw::c_char, + pub _IO_write_base: *mut ::std::os::raw::c_char, + pub _IO_write_ptr: *mut ::std::os::raw::c_char, + pub _IO_write_end: *mut ::std::os::raw::c_char, + pub _IO_buf_base: *mut ::std::os::raw::c_char, + pub _IO_buf_end: *mut ::std::os::raw::c_char, + pub _IO_save_base: *mut ::std::os::raw::c_char, + pub _IO_backup_base: *mut ::std::os::raw::c_char, + pub _IO_save_end: *mut ::std::os::raw::c_char, + pub _markers: *mut root::_IO_marker, + pub _chain: *mut root::_IO_FILE, + pub _fileno: ::std::os::raw::c_int, + pub _flags2: ::std::os::raw::c_int, + pub _old_offset: root::__off_t, + pub _cur_column: ::std::os::raw::c_ushort, + pub _vtable_offset: ::std::os::raw::c_char, + pub _shortbuf: [::std::os::raw::c_char; 1usize], + pub _lock: *mut root::_IO_lock_t, + pub _offset: root::__off64_t, + pub __pad1: *mut ::std::os::raw::c_void, + pub __pad2: *mut ::std::os::raw::c_void, + pub __pad3: *mut ::std::os::raw::c_void, + pub __pad4: *mut ::std::os::raw::c_void, + pub __pad5: usize, + pub _mode: ::std::os::raw::c_int, + pub _unused2: [::std::os::raw::c_char; 20usize], } #[test] - fn bindgen_test_layout___sbuf() { - assert_eq!(::std::mem::size_of::<__sbuf>() , 16usize , concat ! ( - "Size of: " , stringify ! ( __sbuf ) )); - assert_eq! (::std::mem::align_of::<__sbuf>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( __sbuf ) )); + fn bindgen_test_layout__IO_FILE() { + assert_eq!(::std::mem::size_of::<_IO_FILE>() , 216usize , concat ! ( + "Size of: " , stringify ! ( _IO_FILE ) )); + assert_eq! (::std::mem::align_of::<_IO_FILE>() , 8usize , concat ! ( + "Alignment of " , stringify ! ( _IO_FILE ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sbuf ) ) . _base as * const _ as + & ( * ( 0 as * const _IO_FILE ) ) . _flags as * const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( __sbuf ) , "::" , - stringify ! ( _base ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __sbuf ) ) . _size as * const _ as - usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( __sbuf ) , "::" , - stringify ! ( _size ) )); - } - impl Clone for __sbuf { - fn clone(&self) -> Self { *self } - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct __sFILEX([u8; 0]); - #[repr(C)] - #[derive(Debug, Copy)] - pub struct __sFILE { - pub _p: *mut ::std::os::raw::c_uchar, - pub _r: ::std::os::raw::c_int, - pub _w: ::std::os::raw::c_int, - pub _flags: ::std::os::raw::c_short, - pub _file: ::std::os::raw::c_short, - pub _bf: root::__sbuf, - pub _lbfsize: ::std::os::raw::c_int, - pub _cookie: *mut ::std::os::raw::c_void, - pub _close: ::std::option::Option ::std::os::raw::c_int>, - pub _read: ::std::option::Option ::std::os::raw::c_int>, - pub _seek: ::std::option::Option ::std::os::raw::c_longlong>, - pub _write: ::std::option::Option ::std::os::raw::c_int>, - pub _ub: root::__sbuf, - pub _extra: *mut root::__sFILEX, - pub _ur: ::std::os::raw::c_int, - pub _ubuf: [::std::os::raw::c_uchar; 3usize], - pub _nbuf: [::std::os::raw::c_uchar; 1usize], - pub _lb: root::__sbuf, - pub _blksize: ::std::os::raw::c_int, - pub _offset: root::fpos_t, - } - #[test] - fn bindgen_test_layout___sFILE() { - assert_eq!(::std::mem::size_of::<__sFILE>() , 152usize , concat ! ( - "Size of: " , stringify ! ( __sFILE ) )); - assert_eq! (::std::mem::align_of::<__sFILE>() , 8usize , concat ! ( - "Alignment of " , stringify ! ( __sFILE ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _p as * const _ as - usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _p ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _r as * const _ as - usize } , 8usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _r ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _w as * const _ as - usize } , 12usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _w ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _flags as * const _ as - usize } , 16usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _flags ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _file as * const _ as - usize } , 18usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _file ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_read_ptr as * + const _ as usize } , 8usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_read_ptr ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _bf as * const _ as - usize } , 24usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _bf ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_read_end as * + const _ as usize } , 16usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_read_end ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _lbfsize as * const _ - as usize } , 40usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _lbfsize ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_read_base as * + const _ as usize } , 24usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_read_base ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _cookie as * const _ as - usize } , 48usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _cookie ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_write_base as * + const _ as usize } , 32usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_write_base ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _close as * const _ as - usize } , 56usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _close ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_write_ptr as * + const _ as usize } , 40usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_write_ptr ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _read as * const _ as - usize } , 64usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _read ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_write_end as * + const _ as usize } , 48usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_write_end ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _seek as * const _ as - usize } , 72usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _seek ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_buf_base as * + const _ as usize } , 56usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_buf_base ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _write as * const _ as - usize } , 80usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _write ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_buf_end as * const + _ as usize } , 64usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_buf_end ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _ub as * const _ as - usize } , 88usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _ub ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _IO_save_base as * + const _ as usize } , 72usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_save_base ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _extra as * const _ as + & ( * ( 0 as * const _IO_FILE ) ) . _IO_backup_base as * + const _ as usize } , 80usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_backup_base ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . _IO_save_end as * + const _ as usize } , 88usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _IO_save_end ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . _markers as * const _ + as usize } , 96usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _markers ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . _chain as * const _ as usize } , 104usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _extra ) )); + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _chain ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _ur as * const _ as - usize } , 112usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _ur ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _fileno as * const _ + as usize } , 112usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _fileno ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _ubuf as * const _ as - usize } , 116usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _ubuf ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _flags2 as * const _ + as usize } , 116usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _flags2 ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _nbuf as * const _ as - usize } , 119usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _nbuf ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _old_offset as * const + _ as usize } , 120usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _old_offset ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _lb as * const _ as - usize } , 120usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _lb ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _cur_column as * const + _ as usize } , 128usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _cur_column ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _blksize as * const _ - as usize } , 136usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , - stringify ! ( _blksize ) )); + & ( * ( 0 as * const _IO_FILE ) ) . _vtable_offset as * + const _ as usize } , 130usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _vtable_offset ) )); assert_eq! (unsafe { - & ( * ( 0 as * const __sFILE ) ) . _offset as * const _ as - usize } , 144usize , concat ! ( - "Alignment of field: " , stringify ! ( __sFILE ) , "::" , + & ( * ( 0 as * const _IO_FILE ) ) . _shortbuf as * const _ + as usize } , 131usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _shortbuf ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . _lock as * const _ as + usize } , 136usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _lock ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . _offset as * const _ + as usize } , 144usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , stringify ! ( _offset ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . __pad1 as * const _ as + usize } , 152usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( __pad1 ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . __pad2 as * const _ as + usize } , 160usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( __pad2 ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . __pad3 as * const _ as + usize } , 168usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( __pad3 ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . __pad4 as * const _ as + usize } , 176usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( __pad4 ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . __pad5 as * const _ as + usize } , 184usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( __pad5 ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . _mode as * const _ as + usize } , 192usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _mode ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_FILE ) ) . _unused2 as * const _ + as usize } , 196usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_FILE ) , "::" , + stringify ! ( _unused2 ) )); } - impl Clone for __sFILE { + impl Clone for _IO_FILE { + fn clone(&self) -> Self { *self } + } + pub type FILE = root::_IO_FILE; + pub type va_list = root::__builtin_va_list; + pub type _IO_lock_t = ::std::os::raw::c_void; + #[repr(C)] + #[derive(Debug, Copy)] + pub struct _IO_marker { + pub _next: *mut root::_IO_marker, + pub _sbuf: *mut root::_IO_FILE, + pub _pos: ::std::os::raw::c_int, + } + #[test] + fn bindgen_test_layout__IO_marker() { + assert_eq!(::std::mem::size_of::<_IO_marker>() , 24usize , concat ! ( + "Size of: " , stringify ! ( _IO_marker ) )); + assert_eq! (::std::mem::align_of::<_IO_marker>() , 8usize , concat ! ( + "Alignment of " , stringify ! ( _IO_marker ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_marker ) ) . _next as * const _ + as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_marker ) , "::" + , stringify ! ( _next ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_marker ) ) . _sbuf as * const _ + as usize } , 8usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_marker ) , "::" + , stringify ! ( _sbuf ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const _IO_marker ) ) . _pos as * const _ as + usize } , 16usize , concat ! ( + "Alignment of field: " , stringify ! ( _IO_marker ) , "::" + , stringify ! ( _pos ) )); + } + impl Clone for _IO_marker { fn clone(&self) -> Self { *self } } - pub type FILE = root::__sFILE; /** * MozRefCountType is Mozilla's reference count type. * @@ -9803,92 +9969,21 @@ pub mod root { JS_GENERIC_MAGIC = 16, JS_WHY_MAGIC_COUNT = 17, } + /** + * double-byte (char16_t) string types + */ #[repr(C)] #[derive(Debug)] - pub struct nsAString_internal { - pub mData: *mut root::nsAString_internal_char_type, - 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; - pub type nsAString_internal_iterator = root::nsWritingIterator; - 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 struct nsAString { + pub _base: root::mozilla::detail::nsStringRepr, } + pub type nsAString_self_type = root::nsAString; #[test] - fn bindgen_test_layout_nsAString_internal() { - assert_eq!(::std::mem::size_of::() , 16usize , - concat ! ( "Size of: " , stringify ! ( nsAString_internal ) - )); - assert_eq! (::std::mem::align_of::() , 8usize , - 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 ) )); + fn bindgen_test_layout_nsAString() { + assert_eq!(::std::mem::size_of::() , 16usize , concat ! ( + "Size of: " , stringify ! ( nsAString ) )); + assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( + "Alignment of " , stringify ! ( nsAString ) )); } #[repr(C)] #[derive(Debug, Copy)] @@ -9899,8 +9994,8 @@ pub mod root { } pub type nsSubstringTuple_char_type = u16; pub type nsSubstringTuple_self_type = root::nsSubstringTuple; - pub type nsSubstringTuple_substring_type = root::nsAString_internal; - pub type nsSubstringTuple_base_string_type = root::nsAString_internal; + pub type nsSubstringTuple_base_string_type = + root::mozilla::detail::nsStringRepr; pub type nsSubstringTuple_size_type = u32; #[test] fn bindgen_test_layout_nsSubstringTuple() { @@ -9932,7 +10027,7 @@ pub mod root { #[repr(C)] pub struct nsAutoString { 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 const nsAutoString_kDefaultStorageSize: @@ -9956,7 +10051,7 @@ pub mod root { #[repr(C)] #[derive(Debug)] pub struct nsDependentSubstring { - pub _base: root::nsAString_internal, + pub _base: root::nsAString, } pub type nsDependentSubstring_self_type = root::nsDependentSubstring; #[test] @@ -9989,95 +10084,21 @@ pub mod root { impl Clone for nsStringComparator { fn clone(&self) -> Self { *self } } + /** + * single-byte (char) string types + */ #[repr(C)] #[derive(Debug)] - pub struct nsACString_internal { - pub mData: *mut root::nsACString_internal_char_type, - 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 struct nsACString { + pub _base: root::mozilla::detail::nsCStringRepr, } + pub type nsACString_self_type = root::nsACString; #[test] - fn bindgen_test_layout_nsACString_internal() { - assert_eq!(::std::mem::size_of::() , 16usize , - concat ! ( - "Size of: " , stringify ! ( nsACString_internal ) )); - assert_eq! (::std::mem::align_of::() , 8usize , - 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 ) )); + fn bindgen_test_layout_nsACString() { + assert_eq!(::std::mem::size_of::() , 16usize , concat ! ( + "Size of: " , stringify ! ( nsACString ) )); + assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( + "Alignment of " , stringify ! ( nsACString ) )); } #[repr(C)] #[derive(Debug, Copy)] @@ -10088,8 +10109,8 @@ pub mod root { } pub type nsCSubstringTuple_char_type = ::std::os::raw::c_char; pub type nsCSubstringTuple_self_type = root::nsCSubstringTuple; - pub type nsCSubstringTuple_substring_type = root::nsACString_internal; - pub type nsCSubstringTuple_base_string_type = root::nsACString_internal; + pub type nsCSubstringTuple_base_string_type = + root::mozilla::detail::nsCStringRepr; pub type nsCSubstringTuple_size_type = u32; #[test] fn bindgen_test_layout_nsCSubstringTuple() { @@ -10121,7 +10142,7 @@ pub mod root { #[repr(C)] #[derive(Debug)] pub struct nsCString { - pub _base: root::nsACString_internal, + pub _base: root::nsACString, } pub type nsCString_self_type = root::nsCString; #[repr(C)] @@ -10162,7 +10183,7 @@ pub mod root { #[repr(C)] #[derive(Debug)] pub struct nsDependentCSubstring { - pub _base: root::nsACString_internal, + pub _base: root::nsACString, } pub type nsDependentCSubstring_self_type = root::nsDependentCSubstring; #[test] @@ -10199,7 +10220,7 @@ pub mod root { /** * typedefs for backwards compatibility */ - pub type nsSubstring = root::nsAString_internal; + pub type nsSubstring = root::nsAString; pub type nsAFlatCString = root::nsCString; #[repr(C)] pub struct nsISupports__bindgen_vtable { @@ -10335,16 +10356,16 @@ pub mod root { #[repr(C)] #[derive(Debug)] pub struct nsSubstringSplitter { - pub mStr: *const root::nsAString_internal, + pub mStr: *const root::nsAString, pub mArray: root::mozilla::UniquePtr<[root::nsDependentSubstring; 0usize], root::mozilla::DefaultDelete<[root::nsDependentSubstring; 0usize]>>, pub mArraySize: root::nsSubstringSplitter_size_type, pub mDelim: root::nsSubstringSplitter_char_type, } pub type nsSubstringSplitter_size_type = - root::nsAString_internal_size_type; + root::mozilla::detail::nsStringRepr_size_type; pub type nsSubstringSplitter_char_type = - root::nsAString_internal_char_type; + root::mozilla::detail::nsStringRepr_char_type; #[repr(C)] #[derive(Debug, Copy)] pub struct nsSubstringSplitter_nsTSubstringSplit_Iter { @@ -10413,16 +10434,16 @@ pub mod root { #[repr(C)] #[derive(Debug)] pub struct nsCSubstringSplitter { - pub mStr: *const root::nsACString_internal, + pub mStr: *const root::nsACString, pub mArray: root::mozilla::UniquePtr<[root::nsDependentCSubstring; 0usize], root::mozilla::DefaultDelete<[root::nsDependentCSubstring; 0usize]>>, pub mArraySize: root::nsCSubstringSplitter_size_type, pub mDelim: root::nsCSubstringSplitter_char_type, } pub type nsCSubstringSplitter_size_type = - root::nsACString_internal_size_type; + root::mozilla::detail::nsCStringRepr_size_type; pub type nsCSubstringSplitter_char_type = - root::nsACString_internal_char_type; + root::mozilla::detail::nsCStringRepr_char_type; #[repr(C)] #[derive(Debug, Copy)] pub struct nsCSubstringSplitter_nsTSubstringSplit_Iter { @@ -10493,8 +10514,8 @@ pub mod root { #[derive(Debug)] pub struct nsFixedString { pub _base: ::nsstring::nsStringRepr, - pub mFixedCapacity: root::nsAString_internal_size_type, - pub mFixedBuf: *mut root::nsAString_internal_char_type, + pub mFixedCapacity: root::mozilla::detail::nsStringRepr_size_type, + pub mFixedBuf: *mut root::mozilla::detail::nsStringRepr_char_type, } pub type nsFixedString_self_type = root::nsFixedString; pub type nsFixedString_fixed_string_type = root::nsFixedString; @@ -15620,63 +15641,63 @@ pub mod root { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsDOMMutationObserver([u8; 0]); - pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_LISTENERMANAGER; - pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_PROPERTIES; - pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_IS_ANONYMOUS_ROOT; - pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; - pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_IS_NATIVE_ANONYMOUS_ROOT; - pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_FORCE_XBL_BINDINGS; - pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_MAY_BE_IN_BINDING_MNGR; - pub const NODE_IS_EDITABLE: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_IS_EDITABLE; - pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_IS_NATIVE_ANONYMOUS; - pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_IS_IN_SHADOW_TREE; - pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_EMPTY_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_SLOW_SELECTOR; - pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_EDGE_CHILD_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; - pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_ALL_SELECTOR_FLAGS; - pub const NODE_NEEDS_FRAME: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_NEEDS_FRAME; - pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_DESCENDANTS_NEED_FRAMES; - pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_ACCESSKEY; - pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_DIRECTION_RTL; - pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_DIRECTION_LTR; - pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_ALL_DIRECTION_FLAGS; - pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_CHROME_ONLY_ACCESS; - pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; - pub const NODE_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_SHARED_RESTYLE_BIT_1; - pub const NODE_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_SHARED_RESTYLE_BIT_2; - pub const NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_SHARED_RESTYLE_BIT_1; - pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_TYPE_SPECIFIC_BITS_OFFSET; + pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_LISTENERMANAGER; + pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_PROPERTIES; + pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_IS_ANONYMOUS_ROOT; + pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; + pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_IS_NATIVE_ANONYMOUS_ROOT; + pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_FORCE_XBL_BINDINGS; + pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_MAY_BE_IN_BINDING_MNGR; + pub const NODE_IS_EDITABLE: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_IS_EDITABLE; + pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_IS_NATIVE_ANONYMOUS; + pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_IS_IN_SHADOW_TREE; + pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_EMPTY_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_SLOW_SELECTOR; + pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_EDGE_CHILD_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; + pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_ALL_SELECTOR_FLAGS; + pub const NODE_NEEDS_FRAME: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_NEEDS_FRAME; + pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_DESCENDANTS_NEED_FRAMES; + pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_ACCESSKEY; + pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_DIRECTION_RTL; + pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_HAS_DIRECTION_LTR; + pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_ALL_DIRECTION_FLAGS; + pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_CHROME_ONLY_ACCESS; + pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; + pub const NODE_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_SHARED_RESTYLE_BIT_1; + pub const NODE_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_SHARED_RESTYLE_BIT_2; + pub const NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_SHARED_RESTYLE_BIT_1; + pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_118 = + _bindgen_ty_118::NODE_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_28 { + pub enum _bindgen_ty_118 { NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_PROPERTIES = 8, NODE_IS_ANONYMOUS_ROOT = 16, diff --git a/components/style/gecko_bindings/structs_release.rs b/components/style/gecko_bindings/structs_release.rs index e7940b9824d..606330565b4 100644 --- a/components/style/gecko_bindings/structs_release.rs +++ b/components/style/gecko_bindings/structs_release.rs @@ -1444,6 +1444,192 @@ pub mod root { pub type LinkedListElementTraits_ConstRawType = *mut T; pub type LinkedListElementTraits_ClientType = *mut T; pub type LinkedListElementTraits_ConstClientType = *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; + pub type nsStringRepr_iterator = root::nsWritingIterator; + 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::() , 16usize , + concat ! ( + "Size of: " , stringify ! ( nsStringRepr ) )); + assert_eq! (::std::mem::align_of::() , 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::() , 16usize , + concat ! ( + "Size of: " , stringify ! ( nsCStringRepr ) )); + assert_eq! (::std::mem::align_of::() , 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 = ::std::option::Option, pub mNamespaceID: i32, pub mNodeType: u16, - pub mNameString: *const root::nsAString_internal, + pub mNameString: *const root::nsAString, pub mExtraName: root::nsCOMPtr, } #[test] @@ -4084,6 +4270,7 @@ pub mod root { pub mRootBounds: root::RefPtr, pub mBoundingClientRect: root::RefPtr, pub mIntersectionRect: root::RefPtr, + pub mIsIntersecting: bool, pub mTarget: root::RefPtr, pub mIntersectionRatio: f64, } @@ -4118,7 +4305,7 @@ pub mod root { #[test] fn bindgen_test_layout_DOMIntersectionObserverEntry() { assert_eq!(::std::mem::size_of::() - , 96usize , concat ! ( + , 104usize , concat ! ( "Size of: " , stringify ! ( DOMIntersectionObserverEntry ) )); assert_eq! (::std::mem::align_of::() @@ -7981,12 +8168,6 @@ pub mod root { pub type pair_first_type<_T1> = _T1; pub type pair_second_type<_T2> = _T2; #[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)] pub struct input_iterator_tag { pub _address: u8, @@ -8005,62 +8186,6 @@ pub mod root { fn clone(&self) -> Self { *self } } #[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::() , 1usize - , concat ! ( - "Size of: " , stringify ! ( forward_iterator_tag ) )); - assert_eq! (::std::mem::align_of::() , - 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::() , - 1usize , concat ! ( - "Size of: " , stringify ! ( bidirectional_iterator_tag - ) )); - assert_eq! (::std::mem::align_of::() , - 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::() , - 1usize , concat ! ( - "Size of: " , stringify ! ( random_access_iterator_tag - ) )); - assert_eq! (::std::mem::align_of::() , - 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)] pub struct iterator<_Category, _Tp, _Distance, _Pointer, _Reference> { pub _address: u8, @@ -8070,22 +8195,22 @@ pub mod root { pub _phantom_3: ::std::marker::PhantomData<_Pointer>, pub _phantom_4: ::std::marker::PhantomData<_Reference>, } + pub type iterator_iterator_category<_Category> = _Category; pub type iterator_value_type<_Tp> = _Tp; pub type iterator_difference_type<_Distance> = _Distance; pub type iterator_pointer<_Pointer> = _Pointer; pub type iterator_reference<_Reference> = _Reference; - pub type iterator_iterator_category<_Category> = _Category; #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct __bit_const_reference<_Cp> { - pub __seg_: root::std::__bit_const_reference___storage_pointer<_Cp>, - pub __mask_: root::std::__bit_const_reference___storage_type<_Cp>, + #[derive(Debug)] + pub struct atomic<_Tp> { + pub _M_i: _Tp, } - 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 type va_list = root::__darwin_va_list; + pub mod __gnu_cxx { + #[allow(unused_imports)] + use self::super::super::root; + } + pub type va_list = root::__builtin_va_list; /** * MozRefCountType is Mozilla's reference count type. * @@ -9422,92 +9547,21 @@ pub mod root { JS_GENERIC_MAGIC = 16, JS_WHY_MAGIC_COUNT = 17, } + /** + * double-byte (char16_t) string types + */ #[repr(C)] #[derive(Debug)] - pub struct nsAString_internal { - pub mData: *mut root::nsAString_internal_char_type, - 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; - pub type nsAString_internal_iterator = root::nsWritingIterator; - 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 struct nsAString { + pub _base: root::mozilla::detail::nsStringRepr, } + pub type nsAString_self_type = root::nsAString; #[test] - fn bindgen_test_layout_nsAString_internal() { - assert_eq!(::std::mem::size_of::() , 16usize , - concat ! ( "Size of: " , stringify ! ( nsAString_internal ) - )); - assert_eq! (::std::mem::align_of::() , 8usize , - 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 ) )); + fn bindgen_test_layout_nsAString() { + assert_eq!(::std::mem::size_of::() , 16usize , concat ! ( + "Size of: " , stringify ! ( nsAString ) )); + assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( + "Alignment of " , stringify ! ( nsAString ) )); } #[repr(C)] #[derive(Debug, Copy)] @@ -9518,8 +9572,8 @@ pub mod root { } pub type nsSubstringTuple_char_type = u16; pub type nsSubstringTuple_self_type = root::nsSubstringTuple; - pub type nsSubstringTuple_substring_type = root::nsAString_internal; - pub type nsSubstringTuple_base_string_type = root::nsAString_internal; + pub type nsSubstringTuple_base_string_type = + root::mozilla::detail::nsStringRepr; pub type nsSubstringTuple_size_type = u32; #[test] fn bindgen_test_layout_nsSubstringTuple() { @@ -9551,7 +9605,7 @@ pub mod root { #[repr(C)] pub struct nsAutoString { 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 const nsAutoString_kDefaultStorageSize: @@ -9575,7 +9629,7 @@ pub mod root { #[repr(C)] #[derive(Debug)] pub struct nsDependentSubstring { - pub _base: root::nsAString_internal, + pub _base: root::nsAString, } pub type nsDependentSubstring_self_type = root::nsDependentSubstring; #[test] @@ -9608,95 +9662,21 @@ pub mod root { impl Clone for nsStringComparator { fn clone(&self) -> Self { *self } } + /** + * single-byte (char) string types + */ #[repr(C)] #[derive(Debug)] - pub struct nsACString_internal { - pub mData: *mut root::nsACString_internal_char_type, - 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 struct nsACString { + pub _base: root::mozilla::detail::nsCStringRepr, } + pub type nsACString_self_type = root::nsACString; #[test] - fn bindgen_test_layout_nsACString_internal() { - assert_eq!(::std::mem::size_of::() , 16usize , - concat ! ( - "Size of: " , stringify ! ( nsACString_internal ) )); - assert_eq! (::std::mem::align_of::() , 8usize , - 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 ) )); + fn bindgen_test_layout_nsACString() { + assert_eq!(::std::mem::size_of::() , 16usize , concat ! ( + "Size of: " , stringify ! ( nsACString ) )); + assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( + "Alignment of " , stringify ! ( nsACString ) )); } #[repr(C)] #[derive(Debug, Copy)] @@ -9707,8 +9687,8 @@ pub mod root { } pub type nsCSubstringTuple_char_type = ::std::os::raw::c_char; pub type nsCSubstringTuple_self_type = root::nsCSubstringTuple; - pub type nsCSubstringTuple_substring_type = root::nsACString_internal; - pub type nsCSubstringTuple_base_string_type = root::nsACString_internal; + pub type nsCSubstringTuple_base_string_type = + root::mozilla::detail::nsCStringRepr; pub type nsCSubstringTuple_size_type = u32; #[test] fn bindgen_test_layout_nsCSubstringTuple() { @@ -9740,7 +9720,7 @@ pub mod root { #[repr(C)] #[derive(Debug)] pub struct nsCString { - pub _base: root::nsACString_internal, + pub _base: root::nsACString, } pub type nsCString_self_type = root::nsCString; #[repr(C)] @@ -9781,7 +9761,7 @@ pub mod root { #[repr(C)] #[derive(Debug)] pub struct nsDependentCSubstring { - pub _base: root::nsACString_internal, + pub _base: root::nsACString, } pub type nsDependentCSubstring_self_type = root::nsDependentCSubstring; #[test] @@ -9818,7 +9798,7 @@ pub mod root { /** * typedefs for backwards compatibility */ - pub type nsSubstring = root::nsAString_internal; + pub type nsSubstring = root::nsAString; pub type nsAFlatCString = root::nsCString; #[repr(C)] pub struct nsISupports__bindgen_vtable { @@ -9954,16 +9934,16 @@ pub mod root { #[repr(C)] #[derive(Debug)] pub struct nsSubstringSplitter { - pub mStr: *const root::nsAString_internal, + pub mStr: *const root::nsAString, pub mArray: root::mozilla::UniquePtr<[root::nsDependentSubstring; 0usize], root::mozilla::DefaultDelete<[root::nsDependentSubstring; 0usize]>>, pub mArraySize: root::nsSubstringSplitter_size_type, pub mDelim: root::nsSubstringSplitter_char_type, } pub type nsSubstringSplitter_size_type = - root::nsAString_internal_size_type; + root::mozilla::detail::nsStringRepr_size_type; pub type nsSubstringSplitter_char_type = - root::nsAString_internal_char_type; + root::mozilla::detail::nsStringRepr_char_type; #[repr(C)] #[derive(Debug, Copy)] pub struct nsSubstringSplitter_nsTSubstringSplit_Iter { @@ -10032,16 +10012,16 @@ pub mod root { #[repr(C)] #[derive(Debug)] pub struct nsCSubstringSplitter { - pub mStr: *const root::nsACString_internal, + pub mStr: *const root::nsACString, pub mArray: root::mozilla::UniquePtr<[root::nsDependentCSubstring; 0usize], root::mozilla::DefaultDelete<[root::nsDependentCSubstring; 0usize]>>, pub mArraySize: root::nsCSubstringSplitter_size_type, pub mDelim: root::nsCSubstringSplitter_char_type, } pub type nsCSubstringSplitter_size_type = - root::nsACString_internal_size_type; + root::mozilla::detail::nsCStringRepr_size_type; pub type nsCSubstringSplitter_char_type = - root::nsACString_internal_char_type; + root::mozilla::detail::nsCStringRepr_char_type; #[repr(C)] #[derive(Debug, Copy)] pub struct nsCSubstringSplitter_nsTSubstringSplit_Iter { @@ -10112,8 +10092,8 @@ pub mod root { #[derive(Debug)] pub struct nsFixedString { pub _base: ::nsstring::nsStringRepr, - pub mFixedCapacity: root::nsAString_internal_size_type, - pub mFixedBuf: *mut root::nsAString_internal_char_type, + pub mFixedCapacity: root::mozilla::detail::nsStringRepr_size_type, + pub mFixedBuf: *mut root::mozilla::detail::nsStringRepr_char_type, } pub type nsFixedString_self_type = root::nsFixedString; pub type nsFixedString_fixed_string_type = root::nsFixedString; @@ -15088,63 +15068,63 @@ pub mod root { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsDOMMutationObserver([u8; 0]); - pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_LISTENERMANAGER; - pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_PROPERTIES; - pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_IS_ANONYMOUS_ROOT; - pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; - pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_IS_NATIVE_ANONYMOUS_ROOT; - pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_FORCE_XBL_BINDINGS; - pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_MAY_BE_IN_BINDING_MNGR; - pub const NODE_IS_EDITABLE: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_IS_EDITABLE; - pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_IS_NATIVE_ANONYMOUS; - pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_IS_IN_SHADOW_TREE; - pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_EMPTY_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_SLOW_SELECTOR; - pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_EDGE_CHILD_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; - pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_ALL_SELECTOR_FLAGS; - pub const NODE_NEEDS_FRAME: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_NEEDS_FRAME; - pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_DESCENDANTS_NEED_FRAMES; - pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_ACCESSKEY; - pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_DIRECTION_RTL; - pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_HAS_DIRECTION_LTR; - pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_ALL_DIRECTION_FLAGS; - pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_CHROME_ONLY_ACCESS; - pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; - pub const NODE_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_SHARED_RESTYLE_BIT_1; - pub const NODE_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_SHARED_RESTYLE_BIT_2; - pub const NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_SHARED_RESTYLE_BIT_1; - pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_28 = - _bindgen_ty_28::NODE_TYPE_SPECIFIC_BITS_OFFSET; + pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_HAS_LISTENERMANAGER; + pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_HAS_PROPERTIES; + pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_IS_ANONYMOUS_ROOT; + pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; + pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_IS_NATIVE_ANONYMOUS_ROOT; + pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_FORCE_XBL_BINDINGS; + pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_MAY_BE_IN_BINDING_MNGR; + pub const NODE_IS_EDITABLE: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_IS_EDITABLE; + pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_IS_NATIVE_ANONYMOUS; + pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_IS_IN_SHADOW_TREE; + pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_HAS_EMPTY_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_HAS_SLOW_SELECTOR; + pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_HAS_EDGE_CHILD_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; + pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_ALL_SELECTOR_FLAGS; + pub const NODE_NEEDS_FRAME: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_NEEDS_FRAME; + pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_DESCENDANTS_NEED_FRAMES; + pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_HAS_ACCESSKEY; + pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_HAS_DIRECTION_RTL; + pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_HAS_DIRECTION_LTR; + pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_ALL_DIRECTION_FLAGS; + pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_CHROME_ONLY_ACCESS; + pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; + pub const NODE_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_SHARED_RESTYLE_BIT_1; + pub const NODE_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_SHARED_RESTYLE_BIT_2; + pub const NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_SHARED_RESTYLE_BIT_1; + pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_105 = + _bindgen_ty_105::NODE_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_28 { + pub enum _bindgen_ty_105 { NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_PROPERTIES = 8, NODE_IS_ANONYMOUS_ROOT = 16, From 88c69206ebb2e98965a7571f9788f81c10b512b9 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Fri, 17 Mar 2017 12:27:50 +0900 Subject: [PATCH 2/7] Do not call get_animation_rules for pseudo elements other than ::before and ::after. --- components/style/matching.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/style/matching.rs b/components/style/matching.rs index 619e1d57f7a..296862cfe20 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -14,7 +14,7 @@ use cache::{LRUCache, LRUCacheMutIterator}; use cascade_info::CascadeInfo; use context::{SequentialTask, SharedStyleContext, StyleContext}; 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::longhands::display::computed_value as display; use restyle_hints::{RESTYLE_STYLE_ATTRIBUTE, RestyleHint}; @@ -800,7 +800,11 @@ pub trait MatchMethods : TElement { SelectorImpl::each_eagerly_cascaded_pseudo_element(|pseudo| { let mut per_pseudo = &mut data.styles_mut().pseudos; debug_assert!(applicable_declarations.is_empty()); - let pseudo_animation_rules = self.get_animation_rules(Some(&pseudo)); + let pseudo_animation_rules = if ::Impl::pseudo_is_before_or_after(&pseudo) { + self.get_animation_rules(Some(&pseudo)) + } else { + AnimationRules(None, None) + }; stylist.push_applicable_declarations(self, Some(context.thread_local.bloom_filter.filter()), None, pseudo_animation_rules, From ba18c14b91573f1a16907655c00dfb394414001d Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Fri, 17 Mar 2017 12:28:37 +0900 Subject: [PATCH 3/7] Split get_animation_rules into get_animation_rule and get_transition_rule. If an element has only CSS animations we don't need to get transition rule, and vice versa. This will be used when we implement eRestyle_CSSAnimations and eRestyle_CSSTransitions. --- components/style/dom.rs | 12 ++++++++++++ components/style/gecko/wrapper.rs | 18 +++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/components/style/dom.rs b/components/style/dom.rs index d4f8d979309..612105c20e9 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -259,6 +259,18 @@ pub trait TElement : PartialEq + Debug + Sized + Copy + Clone + ElementExt + Pre AnimationRules(None, None) } + /// Get this element's animation rule. + fn get_animation_rule(&self, _pseudo: Option<&PseudoElement>) + -> Option>> { + None + } + + /// Get this element's transition rule. + fn get_transition_rule(&self, _pseudo: Option<&PseudoElement>) + -> Option>> { + None + } + /// Get this element's state, for non-tree-structural pseudos. fn get_state(&self) -> ElementState; diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 86ac901e407..4182685ec49 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -416,12 +416,20 @@ impl<'le> TElement for GeckoElement<'le> { } fn get_animation_rules(&self, pseudo: Option<&PseudoElement>) -> AnimationRules { + AnimationRules(self.get_animation_rule(pseudo), + self.get_transition_rule(pseudo)) + } + + fn get_animation_rule(&self, pseudo: Option<&PseudoElement>) + -> Option>> { let atom_ptr = PseudoElement::ns_atom_or_null_from_opt(pseudo); - unsafe { - AnimationRules( - Gecko_GetAnimationRule(self.0, atom_ptr, CascadeLevel::Animations).into_arc_opt(), - Gecko_GetAnimationRule(self.0, atom_ptr, CascadeLevel::Transitions).into_arc_opt()) - } + unsafe { Gecko_GetAnimationRule(self.0, atom_ptr, CascadeLevel::Animations).into_arc_opt() } + } + + fn get_transition_rule(&self, pseudo: Option<&PseudoElement>) + -> Option>> { + let atom_ptr = PseudoElement::ns_atom_or_null_from_opt(pseudo); + unsafe { Gecko_GetAnimationRule(self.0, atom_ptr, CascadeLevel::Transitions).into_arc_opt() } } fn get_state(&self) -> ElementState { From 52bee9a4cfd2752d2c18b06399d765b5b34a431b Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Fri, 17 Mar 2017 12:29:08 +0900 Subject: [PATCH 4/7] Add AnimationValueMap and expose it in FFI. Current Gecko composes all of effects in the composite order at once. We can put each computed value into this AnimationValueMap every time composing an effect. --- components/style/build_gecko.rs | 2 ++ components/style/gecko/arc_types.rs | 7 +++++-- components/style/gecko_bindings/bindings.rs | 12 ++++++++++++ components/style/gecko_bindings/structs_debug.rs | 5 +++++ components/style/gecko_bindings/structs_release.rs | 5 +++++ .../properties/helpers/animated_properties.mako.rs | 7 +++++++ 6 files changed, 36 insertions(+), 2 deletions(-) diff --git a/components/style/build_gecko.rs b/components/style/build_gecko.rs index 8dbbc7f749b..88916c3f886 100644 --- a/components/style/build_gecko.rs +++ b/components/style/build_gecko.rs @@ -421,6 +421,7 @@ mod bindings { "mozilla::Side", "mozilla::binding_danger::AssertAndSuppressCleanupPolicy", "RawServoAnimationValueBorrowedListBorrowed", + "RawServoAnimationValueMapBorrowed", ]; let opaque_types = [ "std::pair__PCCP", @@ -541,6 +542,7 @@ mod bindings { "RawGeckoNode", "RawGeckoAnimationValueList", "RawServoAnimationValue", + "RawServoAnimationValueMap", "RawServoDeclarationBlock", "RawGeckoPresContext", "RawGeckoPresContextOwned", diff --git a/components/style/gecko/arc_types.rs b/components/style/gecko/arc_types.rs index 43a87f6b35f..d822857a9e6 100644 --- a/components/style/gecko/arc_types.rs +++ b/components/style/gecko/arc_types.rs @@ -11,12 +11,12 @@ 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}; +use gecko_bindings::structs::{RawServoAnimationValue, RawServoAnimationValueMap, RawServoDeclarationBlock}; use gecko_bindings::sugar::ownership::{HasArcFFI, HasFFI}; use media_queries::MediaList; use parking_lot::RwLock; use properties::{ComputedValues, PropertyDeclarationBlock}; -use properties::animated_properties::AnimationValue; +use properties::animated_properties::{AnimationValue, AnimationValueMap}; use stylesheets::{CssRules, Stylesheet, StyleRule, ImportRule, MediaRule, NamespaceRule}; macro_rules! impl_arc_ffi { @@ -59,6 +59,9 @@ impl_arc_ffi!(RwLock => RawServoImportRule impl_arc_ffi!(AnimationValue => RawServoAnimationValue [Servo_AnimationValue_AddRef, Servo_AnimationValue_Release]); +impl_arc_ffi!(RwLock => RawServoAnimationValueMap + [Servo_AnimationValueMap_AddRef, Servo_AnimationValueMap_Release]); + impl_arc_ffi!(RwLock => RawServoMediaList [Servo_MediaList_AddRef, Servo_MediaList_Release]); diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs index 1c0114737e7..81d8b2f3ca1 100644 --- a/components/style/gecko_bindings/bindings.rs +++ b/components/style/gecko_bindings/bindings.rs @@ -11,6 +11,7 @@ use gecko_bindings::structs::RawGeckoComputedKeyframeValuesList; use gecko_bindings::structs::RawGeckoNode; use gecko_bindings::structs::RawGeckoAnimationValueList; use gecko_bindings::structs::RawServoAnimationValue; +use gecko_bindings::structs::RawServoAnimationValueMap; use gecko_bindings::structs::RawServoDeclarationBlock; use gecko_bindings::structs::RawGeckoPresContext; use gecko_bindings::structs::RawGeckoPresContextOwned; @@ -207,6 +208,9 @@ pub struct RawServoImportRule(RawServoImportRuleVoid); pub type RawServoAnimationValueStrong = ::gecko_bindings::sugar::ownership::Strong; pub type RawServoAnimationValueBorrowed<'a> = &'a RawServoAnimationValue; pub type RawServoAnimationValueBorrowedOrNull<'a> = Option<&'a RawServoAnimationValue>; +pub type RawServoAnimationValueMapStrong = ::gecko_bindings::sugar::ownership::Strong; +pub type RawServoAnimationValueMapBorrowed<'a> = &'a RawServoAnimationValueMap; +pub type RawServoAnimationValueMapBorrowedOrNull<'a> = Option<&'a RawServoAnimationValueMap>; pub type RawServoMediaListStrong = ::gecko_bindings::sugar::ownership::Strong; pub type RawServoMediaListBorrowed<'a> = &'a RawServoMediaList; pub type RawServoMediaListBorrowedOrNull<'a> = Option<&'a RawServoMediaList>; @@ -325,6 +329,14 @@ extern "C" { extern "C" { 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" { pub fn Servo_MediaList_AddRef(ptr: RawServoMediaListBorrowed); } diff --git a/components/style/gecko_bindings/structs_debug.rs b/components/style/gecko_bindings/structs_debug.rs index b7441315898..b7631880641 100644 --- a/components/style/gecko_bindings/structs_debug.rs +++ b/components/style/gecko_bindings/structs_debug.rs @@ -25843,6 +25843,9 @@ pub mod root { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct RawServoStyleSet([u8; 0]); + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct RawServoAnimationValueMap([u8; 0]); pub type RawGeckoNode = root::nsINode; pub type RawGeckoElement = root::mozilla::dom::Element; pub type RawGeckoDocument = root::nsIDocument; @@ -25856,6 +25859,8 @@ pub mod root { root::nsTArray<*const root::RawServoAnimationValue>; pub type RawGeckoStyleAnimationList = root::nsStyleAutoArray; + pub type RawServoAnimationValueMapBorrowed = + *const root::RawServoAnimationValueMap; pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode; pub type RawGeckoNodeBorrowedOrNull = *const root::RawGeckoNode; pub type RawGeckoElementBorrowed = *const root::RawGeckoElement; diff --git a/components/style/gecko_bindings/structs_release.rs b/components/style/gecko_bindings/structs_release.rs index 606330565b4..afe41ab3238 100644 --- a/components/style/gecko_bindings/structs_release.rs +++ b/components/style/gecko_bindings/structs_release.rs @@ -25201,6 +25201,9 @@ pub mod root { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct RawServoStyleSet([u8; 0]); + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct RawServoAnimationValueMap([u8; 0]); pub type RawGeckoNode = root::nsINode; pub type RawGeckoElement = root::mozilla::dom::Element; pub type RawGeckoDocument = root::nsIDocument; @@ -25214,6 +25217,8 @@ pub mod root { root::nsTArray<*const root::RawServoAnimationValue>; pub type RawGeckoStyleAnimationList = root::nsStyleAutoArray; + pub type RawServoAnimationValueMapBorrowed = + *const root::RawServoAnimationValueMap; pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode; pub type RawGeckoNodeBorrowedOrNull = *const root::RawGeckoNode; pub type RawGeckoElementBorrowed = *const root::RawGeckoElement; diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 83c3f26c4ce..37dbd3e0da0 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -25,6 +25,7 @@ use properties::longhands::visibility::computed_value::T as Visibility; use properties::longhands::z_index::computed_value::T as ZIndex; #[cfg(feature = "gecko")] use properties::{PropertyDeclarationId, LonghandId}; use std::cmp; +#[cfg(feature = "gecko")] use std::collections::HashMap; use std::fmt; use style_traits::ToCss; 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; + /// An enum to represent a single computed value belonging to an animated /// property in order to be interpolated with another one. When interpolating, /// both values need to belong to the same property. From c0baac4194cf4a73332710c2d651dd46ea718a45 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Fri, 17 Mar 2017 12:30:00 +0900 Subject: [PATCH 5/7] Add a function to convert AnimationValueMap to PropertyDeclarationBlock. We need to convert all AnimationValue (AnimationValueMap) on an element to PropertyDeclarationBlock in order to push the value inside the CSS cascade. Two reasons we did not add the function in AnimationValueMap: 1) All members of PropertyDeclarationBlock are private. 2) Rust does not allow us impl for type alias, so if we do impl the function in AnimationValueMap we need to make AnimationValueMap as a tuple or struct. --- .../style/properties/declaration_block.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/components/style/properties/declaration_block.rs b/components/style/properties/declaration_block.rs index 721396e8b3a..9d76adf1383 100644 --- a/components/style/properties/declaration_block.rs +++ b/components/style/properties/declaration_block.rs @@ -15,6 +15,7 @@ use std::fmt; use style_traits::ToCss; use stylesheets::Origin; use super::*; +#[cfg(feature = "gecko")] use properties::animated_properties::AnimationValueMap; /// 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 { From b21081312411d5dc0ebc0b3779e3ad1845870b0f Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Fri, 17 Mar 2017 12:31:38 +0900 Subject: [PATCH 6/7] Put computed values into AnimationValueMap instead of hashtable in gecko. Before this patch, we store each computed values in a hashtable, nsRefPtrHashtable, for all KeyframeEffectReadOnly on an element, and convert the ServoAnimationValues of the hashtable into an nsTArray and then convert the ServoAnimationValues of the nsTArray into PropertyDeclarationBlock in rust. This way was really inefficient. In this patch, we store the computed values into AnimationValueMap and convert all AnimationValue in the map into PropertyDeclarationBlock after EffectCompositor::GetAnimationRule. --- components/style/gecko/wrapper.rs | 21 +++++++++++++++---- components/style/gecko_bindings/bindings.rs | 13 ++++++++++-- .../style/gecko_bindings/structs_debug.rs | 3 --- .../style/gecko_bindings/structs_release.rs | 3 --- ports/geckolib/glue.rs | 13 ++++++++++++ 5 files changed, 41 insertions(+), 12 deletions(-) diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 4182685ec49..a722677e78f 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -46,6 +46,7 @@ use parking_lot::RwLock; use parser::ParserContextExtraData; use properties::{ComputedValues, parse_style_attribute}; use properties::PropertyDeclarationBlock; +use properties::animated_properties::AnimationValueMap; use rule_tree::CascadeLevel as ServoCascadeLevel; use selector_parser::{ElementExt, Snapshot}; use selectors::Element; @@ -403,6 +404,20 @@ fn selector_flags_to_node_flags(flags: ElementSelectorFlags) -> u32 { gecko_flags } +fn get_animation_rule(element: &GeckoElement, + pseudo: Option<&PseudoElement>, + cascade_level: CascadeLevel) + -> Option>> { + 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> { type ConcreteNode = GeckoNode<'le>; @@ -422,14 +437,12 @@ impl<'le> TElement for GeckoElement<'le> { fn get_animation_rule(&self, pseudo: Option<&PseudoElement>) -> Option>> { - let atom_ptr = PseudoElement::ns_atom_or_null_from_opt(pseudo); - unsafe { Gecko_GetAnimationRule(self.0, atom_ptr, CascadeLevel::Animations).into_arc_opt() } + get_animation_rule(self, pseudo, CascadeLevel::Animations) } fn get_transition_rule(&self, pseudo: Option<&PseudoElement>) -> Option>> { - let atom_ptr = PseudoElement::ns_atom_or_null_from_opt(pseudo); - unsafe { Gecko_GetAnimationRule(self.0, atom_ptr, CascadeLevel::Transitions).into_arc_opt() } + get_animation_rule(self, pseudo, CascadeLevel::Transitions) } fn get_state(&self) -> ElementState { diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs index 81d8b2f3ca1..466421556a4 100644 --- a/components/style/gecko_bindings/bindings.rs +++ b/components/style/gecko_bindings/bindings.rs @@ -582,8 +582,10 @@ extern "C" { pub fn Gecko_GetAnimationRule(aElement: RawGeckoElementBorrowed, aPseudoTag: *mut nsIAtom, aCascadeLevel: - EffectCompositor_CascadeLevel) - -> RawServoDeclarationBlockStrong; + EffectCompositor_CascadeLevel, + aAnimationValues: + RawServoAnimationValueMapBorrowed) + -> bool; } extern "C" { pub fn Gecko_StyleAnimationsEquals(arg1: @@ -1496,6 +1498,13 @@ extern "C" { result: RawGeckoComputedKeyframeValuesListBorrowedMut); } +extern "C" { + pub fn Servo_AnimationValueMap_Push(arg1: + RawServoAnimationValueMapBorrowed, + property: nsCSSPropertyID, + value: + RawServoAnimationValueBorrowed); +} extern "C" { pub fn Servo_AnimationValues_Interpolate(from: RawServoAnimationValueBorrowed, diff --git a/components/style/gecko_bindings/structs_debug.rs b/components/style/gecko_bindings/structs_debug.rs index b7631880641..b61e83a8c6f 100644 --- a/components/style/gecko_bindings/structs_debug.rs +++ b/components/style/gecko_bindings/structs_debug.rs @@ -8214,9 +8214,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct ServoAnimationRule([u8; 0]); - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct AnimationPerformanceWarning([u8; 0]); pub type CSSPseudoClassTypeBase = u8; #[repr(u8)] diff --git a/components/style/gecko_bindings/structs_release.rs b/components/style/gecko_bindings/structs_release.rs index afe41ab3238..c707ea195da 100644 --- a/components/style/gecko_bindings/structs_release.rs +++ b/components/style/gecko_bindings/structs_release.rs @@ -8026,9 +8026,6 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct ServoAnimationRule([u8; 0]); - #[repr(C)] - #[derive(Debug, Copy, Clone)] pub struct AnimationPerformanceWarning([u8; 0]); pub type CSSPseudoClassTypeBase = u8; #[repr(u8)] diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 07be5c8fce3..6d91e836199 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -45,6 +45,7 @@ use style::gecko_bindings::bindings::Gecko_AnimationAppendKeyframe; use style::gecko_bindings::bindings::RawGeckoComputedKeyframeValuesListBorrowedMut; use style::gecko_bindings::bindings::RawGeckoElementBorrowed; use style::gecko_bindings::bindings::RawServoAnimationValueBorrowed; +use style::gecko_bindings::bindings::RawServoAnimationValueMapBorrowed; use style::gecko_bindings::bindings::RawServoAnimationValueStrong; use style::gecko_bindings::bindings::RawServoImportRuleBorrowed; use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull; @@ -247,6 +248,18 @@ pub extern "C" fn Servo_AnimationValues_Interpolate(from: RawServoAnimationValue } } +#[no_mangle] +pub extern "C" fn Servo_AnimationValueMap_Push(value_map: RawServoAnimationValueMapBorrowed, + property: nsCSSPropertyID, + value: RawServoAnimationValueBorrowed) +{ + use style::properties::animated_properties::AnimationValueMap; + + let value_map = RwLock::::as_arc(&value_map); + let value = AnimationValue::as_arc(&value).as_ref(); + value_map.write().insert(property.into(), value.clone()); +} + #[no_mangle] pub extern "C" fn Servo_AnimationValues_Uncompute(value: RawServoAnimationValueBorrowedListBorrowed) -> RawServoDeclarationBlockStrong From 254d5f622950d2f0519ed1dc55048009d1a55f38 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Fri, 17 Mar 2017 12:38:25 +0900 Subject: [PATCH 7/7] Drop Servo_AnimationValues_Uncompute. --- components/style/build_gecko.rs | 2 -- components/style/gecko_bindings/bindings.rs | 6 ------ components/style/gecko_bindings/structs_debug.rs | 8 ++------ .../style/gecko_bindings/structs_release.rs | 8 ++------ ports/geckolib/glue.rs | 15 --------------- 5 files changed, 4 insertions(+), 35 deletions(-) diff --git a/components/style/build_gecko.rs b/components/style/build_gecko.rs index 88916c3f886..d3f894b519e 100644 --- a/components/style/build_gecko.rs +++ b/components/style/build_gecko.rs @@ -420,7 +420,6 @@ mod bindings { "mozilla::DefaultDelete", "mozilla::Side", "mozilla::binding_danger::AssertAndSuppressCleanupPolicy", - "RawServoAnimationValueBorrowedListBorrowed", "RawServoAnimationValueMapBorrowed", ]; let opaque_types = [ @@ -622,7 +621,6 @@ mod bindings { "Loader", "ServoStyleSheet", "EffectCompositor_CascadeLevel", - "RawServoAnimationValueBorrowedListBorrowed", ]; struct ArrayType { cpp_type: &'static str, diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs index 466421556a4..d2b914fea54 100644 --- a/components/style/gecko_bindings/bindings.rs +++ b/components/style/gecko_bindings/bindings.rs @@ -175,7 +175,6 @@ use gecko_bindings::structs::nsresult; use gecko_bindings::structs::Loader; use gecko_bindings::structs::ServoStyleSheet; use gecko_bindings::structs::EffectCompositor_CascadeLevel; -use gecko_bindings::structs::RawServoAnimationValueBorrowedListBorrowed; pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray; pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong; pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules; @@ -1513,11 +1512,6 @@ extern "C" { progress: f64) -> RawServoAnimationValueStrong; } -extern "C" { - pub fn Servo_AnimationValues_Uncompute(value: - RawServoAnimationValueBorrowedListBorrowed) - -> RawServoDeclarationBlockStrong; -} extern "C" { pub fn Servo_AnimationValue_Serialize(value: RawServoAnimationValueBorrowed, diff --git a/components/style/gecko_bindings/structs_debug.rs b/components/style/gecko_bindings/structs_debug.rs index b61e83a8c6f..0d6f563f69e 100644 --- a/components/style/gecko_bindings/structs_debug.rs +++ b/components/style/gecko_bindings/structs_debug.rs @@ -25836,10 +25836,10 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct RawServoAnimationValue([u8; 0]); + pub struct RawServoStyleSet([u8; 0]); #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct RawServoStyleSet([u8; 0]); + pub struct RawServoAnimationValue([u8; 0]); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct RawServoAnimationValueMap([u8; 0]); @@ -25852,8 +25852,6 @@ pub mod root { root::nsTArray>; pub type RawGeckoAnimationValueList = root::nsTArray; - pub type RawServoAnimationValueBorrowedList = - root::nsTArray<*const root::RawServoAnimationValue>; pub type RawGeckoStyleAnimationList = root::nsStyleAutoArray; pub type RawServoAnimationValueMapBorrowed = @@ -25869,8 +25867,6 @@ pub mod root { pub type RawGeckoPresContextBorrowedMut = *mut root::RawGeckoPresContext; pub type RawGeckoAnimationValueListBorrowedMut = *mut root::RawGeckoAnimationValueList; - pub type RawServoAnimationValueBorrowedListBorrowed = - *const root::RawServoAnimationValueBorrowedList; pub type RawGeckoKeyframeListBorrowedMut = *mut root::RawGeckoKeyframeList; pub type RawGeckoKeyframeListBorrowed = *const root::RawGeckoKeyframeList; diff --git a/components/style/gecko_bindings/structs_release.rs b/components/style/gecko_bindings/structs_release.rs index c707ea195da..3274a8d8837 100644 --- a/components/style/gecko_bindings/structs_release.rs +++ b/components/style/gecko_bindings/structs_release.rs @@ -25194,10 +25194,10 @@ pub mod root { } #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct RawServoAnimationValue([u8; 0]); + pub struct RawServoStyleSet([u8; 0]); #[repr(C)] #[derive(Debug, Copy, Clone)] - pub struct RawServoStyleSet([u8; 0]); + pub struct RawServoAnimationValue([u8; 0]); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct RawServoAnimationValueMap([u8; 0]); @@ -25210,8 +25210,6 @@ pub mod root { root::nsTArray>; pub type RawGeckoAnimationValueList = root::nsTArray; - pub type RawServoAnimationValueBorrowedList = - root::nsTArray<*const root::RawServoAnimationValue>; pub type RawGeckoStyleAnimationList = root::nsStyleAutoArray; pub type RawServoAnimationValueMapBorrowed = @@ -25227,8 +25225,6 @@ pub mod root { pub type RawGeckoPresContextBorrowedMut = *mut root::RawGeckoPresContext; pub type RawGeckoAnimationValueListBorrowedMut = *mut root::RawGeckoAnimationValueList; - pub type RawServoAnimationValueBorrowedListBorrowed = - *const root::RawServoAnimationValueBorrowedList; pub type RawGeckoKeyframeListBorrowedMut = *mut root::RawGeckoKeyframeList; pub type RawGeckoKeyframeListBorrowed = *const root::RawGeckoKeyframeList; diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 6d91e836199..e2426edd07a 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -56,7 +56,6 @@ use style::gecko_bindings::structs::{ThreadSafePrincipalHolder, ThreadSafeURIHol use style::gecko_bindings::structs::{nsRestyleHint, nsChangeHint}; use style::gecko_bindings::structs::Loader; use style::gecko_bindings::structs::RawGeckoPresContextOwned; -use style::gecko_bindings::structs::RawServoAnimationValueBorrowedListBorrowed; use style::gecko_bindings::structs::ServoStyleSheet; use style::gecko_bindings::structs::nsCSSValueSharedList; use style::gecko_bindings::structs::nsTimingFunction; @@ -260,20 +259,6 @@ pub extern "C" fn Servo_AnimationValueMap_Push(value_map: RawServoAnimationValue value_map.write().insert(property.into(), value.clone()); } -#[no_mangle] -pub extern "C" fn Servo_AnimationValues_Uncompute(value: RawServoAnimationValueBorrowedListBorrowed) - -> RawServoDeclarationBlockStrong -{ - let value = unsafe { value.as_ref().unwrap() }; - let mut block = PropertyDeclarationBlock::new(); - for v in value.iter() { - let raw_anim = unsafe { v.as_ref().unwrap() }; - let anim = AnimationValue::as_arc(&raw_anim); - block.push(anim.uncompute(), Importance::Normal); - } - Arc::new(RwLock::new(block)).into_strong() -} - macro_rules! get_property_id_from_nscsspropertyid { ($property_id: ident, $ret: expr) => {{ match PropertyId::from_nscsspropertyid($property_id) {