author | Sebastian Hengst <archaeopteryx@coole-files.de> |
Wed, 20 Sep 2017 16:53:11 +0200 | |
changeset 381919 | 0a26b0e8ffeb6a26e0c2149091a6942e6920fb58 |
parent 381918 | ff6c67a5c98680051727e4e9aac42fd28ca59119 |
child 381920 | ab1e0e06445226d0cadf3a1f12fac576c770584d |
push id | 32542 |
push user | kwierso@gmail.com |
push date | Wed, 20 Sep 2017 21:07:55 +0000 |
treeherder | mozilla-central@319a34bea9e4 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | backout |
bugs | 1400438 |
milestone | 57.0a1 |
backs out | 5b56ebe80e22951f549728908f5551d4c6379148 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/servo/components/style/gecko/generated/bindings.rs +++ b/servo/components/style/gecko/generated/bindings.rs @@ -66,16 +66,17 @@ use gecko_bindings::structs::ServoElemen use gecko_bindings::structs::ServoElementSnapshotTable; use gecko_bindings::structs::ServoStyleSetSizes; use gecko_bindings::structs::SheetParsingMode; use gecko_bindings::structs::StyleBasicShape; use gecko_bindings::structs::StyleBasicShapeType; use gecko_bindings::structs::StyleShapeSource; use gecko_bindings::structs::StyleTransition; use gecko_bindings::structs::gfxFontFeatureValueSet; +use gecko_bindings::structs::nsBorderColors; use gecko_bindings::structs::nsCSSCounterStyleRule; use gecko_bindings::structs::nsCSSFontFaceRule; use gecko_bindings::structs::nsCSSKeyword; use gecko_bindings::structs::nsCSSPropertyID; use gecko_bindings::structs::nsCSSPropertyIDSet; use gecko_bindings::structs::nsCSSShadowArray; use gecko_bindings::structs::nsCSSUnit; use gecko_bindings::structs::nsCSSValue; @@ -871,20 +872,32 @@ extern "C" { aString: *const ::std::os::raw::c_char, aLength: u32) -> bool; } extern "C" { pub fn Gecko_EnsureMozBorderColors(aBorder: *mut nsStyleBorder); } extern "C" { + pub fn Gecko_ClearMozBorderColors(aBorder: *mut nsStyleBorder, + aSide: Side); +} +extern "C" { + pub fn Gecko_AppendMozBorderColors(aBorder: *mut nsStyleBorder, + aSide: Side, aColor: nscolor); +} +extern "C" { pub fn Gecko_CopyMozBorderColors(aDest: *mut nsStyleBorder, aSrc: *const nsStyleBorder, aSide: Side); } extern "C" { + pub fn Gecko_GetMozBorderColors(aBorder: *const nsStyleBorder, + aSide: Side) -> *const nsBorderColors; +} +extern "C" { pub fn Gecko_FontFamilyList_Clear(aList: *mut FontFamilyList); } extern "C" { pub fn Gecko_FontFamilyList_AppendNamed(aList: *mut FontFamilyList, aName: *mut nsIAtom, aQuoted: bool); } extern "C" {
--- a/servo/components/style/gecko/generated/structs_debug.rs +++ b/servo/components/style/gecko/generated/structs_debug.rs @@ -14279,17 +14279,17 @@ pub mod root { & ( * ( 0 as * const nsStylePadding ) ) . mPadding as * const _ as usize } , 0usize , concat ! ( "Alignment of field: " , stringify ! ( nsStylePadding ) , "::" , stringify ! ( mPadding ) )); } #[repr(C)] #[derive(Debug)] pub struct nsStyleBorder { - pub mBorderColors: root::mozilla::UniquePtr<root::nsBorderColors>, + pub mBorderColors: *mut *mut root::nsBorderColors, pub mBorderRadius: root::nsStyleCorners, pub mBorderImageSource: root::nsStyleImage, pub mBorderImageSlice: root::nsStyleSides, pub mBorderImageWidth: root::nsStyleSides, pub mBorderImageOutset: root::nsStyleSides, pub mBorderImageFill: u8, pub mBorderImageRepeatH: u8, pub mBorderImageRepeatV: u8, @@ -30539,16 +30539,39 @@ pub mod root { assert_eq! (unsafe { & ( * ( 0 as * const nsStyleImageLayers ) ) . mLayers as * const _ as usize } , 48usize , concat ! ( "Alignment of field: " , stringify ! ( nsStyleImageLayers ) , "::" , stringify ! ( mLayers ) )); } #[repr(C)] #[derive(Debug)] + pub struct nsBorderColors { + pub mNext: *mut root::nsBorderColors, + pub mColor: root::nscolor, + } + #[test] + fn bindgen_test_layout_nsBorderColors() { + assert_eq!(::std::mem::size_of::<nsBorderColors>() , 16usize , concat + ! ( "Size of: " , stringify ! ( nsBorderColors ) )); + assert_eq! (::std::mem::align_of::<nsBorderColors>() , 8usize , concat + ! ( "Alignment of " , stringify ! ( nsBorderColors ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsBorderColors ) ) . mNext as * const + _ as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( nsBorderColors ) , + "::" , stringify ! ( mNext ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsBorderColors ) ) . mColor as * + const _ as usize } , 8usize , concat ! ( + "Alignment of field: " , stringify ! ( nsBorderColors ) , + "::" , stringify ! ( mColor ) )); + } + #[repr(C)] + #[derive(Debug)] pub struct nsCSSShadowItem { pub mXOffset: root::nscoord, pub mYOffset: root::nscoord, pub mRadius: root::nscoord, pub mSpread: root::nscoord, pub mColor: root::nscolor, pub mHasColor: bool, pub mInset: bool, @@ -30623,33 +30646,16 @@ pub mod root { "Alignment of field: " , stringify ! ( nsCSSShadowArray ) , "::" , stringify ! ( mLength ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsCSSShadowArray ) ) . mArray as * const _ as usize } , 12usize , concat ! ( "Alignment of field: " , stringify ! ( nsCSSShadowArray ) , "::" , stringify ! ( mArray ) )); } - #[repr(C)] - #[derive(Debug)] - pub struct nsBorderColors { - pub mColors: [root::nsTArray<::std::os::raw::c_uint>; 4usize], - } - #[test] - fn bindgen_test_layout_nsBorderColors() { - assert_eq!(::std::mem::size_of::<nsBorderColors>() , 32usize , concat - ! ( "Size of: " , stringify ! ( nsBorderColors ) )); - assert_eq! (::std::mem::align_of::<nsBorderColors>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( nsBorderColors ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsBorderColors ) ) . mColors as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( nsBorderColors ) , - "::" , stringify ! ( mColors ) )); - } /// An object that allows sharing of arrays that store 'quotes' property /// values. This is particularly important for inheritance, where we want /// to share the same 'quotes' value with a parent style context. #[repr(C)] #[derive(Debug)] pub struct nsStyleQuoteValues { pub mRefCnt: root::mozilla::ThreadSafeAutoRefCnt, pub mQuotePairs: root::nsStyleQuoteValues_QuotePairArray, @@ -33508,38 +33514,16 @@ pub mod root { "Size of template specialization: " , stringify ! ( root::RefPtr<root::nsCSSValueSharedList> ) )); assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsCSSValueSharedList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root::RefPtr<root::nsCSSValueSharedList> ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_open0_nsBorderColors_DefaultDelete_open1_nsBorderColors_close1_close0_instantiation() { - assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsBorderColors>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::UniquePtr<root::nsBorderColors> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::nsBorderColors>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::UniquePtr<root::nsBorderColors> ) )); - } - #[test] - fn __bindgen_test_layout_DefaultDelete_open0_nsBorderColors_close0_instantiation() { - assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - } - #[test] fn __bindgen_test_layout_nsTArray_open0_nsStyleFilter_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleFilter>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( root::nsTArray<root::nsStyleFilter> ) )); assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleFilter>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( @@ -33585,27 +33569,16 @@ pub mod root { "Size of template specialization: " , stringify ! ( root::nsTArray<::nsstring::nsStringRepr> ) )); assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTString_open0_char16_t_close0_instantiation_2() { - assert_eq!(::std::mem::size_of::<::nsstring::nsStringRepr>() , 16usize , - concat ! ( - "Size of template specialization: " , stringify ! ( - ::nsstring::nsStringRepr ) )); - assert_eq!(::std::mem::align_of::<::nsstring::nsStringRepr>() , 8usize , - concat ! ( - "Alignment of template specialization: " , stringify ! ( - ::nsstring::nsStringRepr ) )); - } - #[test] fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_202536_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( root::nsTArray<*mut root::mozilla::StyleSheet> ) )); assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( @@ -34828,27 +34801,16 @@ pub mod root { "Size of template specialization: " , stringify ! ( root::nsTArray<::nsstring::nsStringRepr> ) )); assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTString_open0_char16_t_close0_instantiation_3() { - assert_eq!(::std::mem::size_of::<::nsstring::nsStringRepr>() , 16usize , - concat ! ( - "Size of template specialization: " , stringify ! ( - ::nsstring::nsStringRepr ) )); - assert_eq!(::std::mem::align_of::<::nsstring::nsStringRepr>() , 8usize , - concat ! ( - "Alignment of template specialization: " , stringify ! ( - ::nsstring::nsStringRepr ) )); - } - #[test] fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_213307_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( root::nsTArray<*mut root::mozilla::StyleSheet> ) )); assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( @@ -36737,27 +36699,16 @@ pub mod root { )); assert_eq!(::std::mem::align_of::<root::nsStyleAutoArray<root::nsStyleImageLayers_Layer>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root::nsStyleAutoArray<root::nsStyleImageLayers_Layer> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0_unsigned_int_close0_instantiation_5() { - assert_eq!(::std::mem::size_of::<root::nsTArray<::std::os::raw::c_uint>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsTArray<::std::os::raw::c_uint> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<::std::os::raw::c_uint>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::nsTArray<::std::os::raw::c_uint> ) )); - } - #[test] fn __bindgen_test_layout_nsTArray_open0_pair_open1_nsString_nsString_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( root::nsTArray<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>> ) )); assert_eq!(::std::mem::align_of::<root::nsTArray<root::std::pair<::nsstring::nsStringRepr,
--- a/servo/components/style/gecko/generated/structs_release.rs +++ b/servo/components/style/gecko/generated/structs_release.rs @@ -14126,17 +14126,17 @@ pub mod root { & ( * ( 0 as * const nsStylePadding ) ) . mPadding as * const _ as usize } , 0usize , concat ! ( "Alignment of field: " , stringify ! ( nsStylePadding ) , "::" , stringify ! ( mPadding ) )); } #[repr(C)] #[derive(Debug)] pub struct nsStyleBorder { - pub mBorderColors: root::mozilla::UniquePtr<root::nsBorderColors>, + pub mBorderColors: *mut *mut root::nsBorderColors, pub mBorderRadius: root::nsStyleCorners, pub mBorderImageSource: root::nsStyleImage, pub mBorderImageSlice: root::nsStyleSides, pub mBorderImageWidth: root::nsStyleSides, pub mBorderImageOutset: root::nsStyleSides, pub mBorderImageFill: u8, pub mBorderImageRepeatH: u8, pub mBorderImageRepeatV: u8, @@ -30125,16 +30125,39 @@ pub mod root { assert_eq! (unsafe { & ( * ( 0 as * const nsStyleImageLayers ) ) . mLayers as * const _ as usize } , 48usize , concat ! ( "Alignment of field: " , stringify ! ( nsStyleImageLayers ) , "::" , stringify ! ( mLayers ) )); } #[repr(C)] #[derive(Debug)] + pub struct nsBorderColors { + pub mNext: *mut root::nsBorderColors, + pub mColor: root::nscolor, + } + #[test] + fn bindgen_test_layout_nsBorderColors() { + assert_eq!(::std::mem::size_of::<nsBorderColors>() , 16usize , concat + ! ( "Size of: " , stringify ! ( nsBorderColors ) )); + assert_eq! (::std::mem::align_of::<nsBorderColors>() , 8usize , concat + ! ( "Alignment of " , stringify ! ( nsBorderColors ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsBorderColors ) ) . mNext as * const + _ as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( nsBorderColors ) , + "::" , stringify ! ( mNext ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsBorderColors ) ) . mColor as * + const _ as usize } , 8usize , concat ! ( + "Alignment of field: " , stringify ! ( nsBorderColors ) , + "::" , stringify ! ( mColor ) )); + } + #[repr(C)] + #[derive(Debug)] pub struct nsCSSShadowItem { pub mXOffset: root::nscoord, pub mYOffset: root::nscoord, pub mRadius: root::nscoord, pub mSpread: root::nscoord, pub mColor: root::nscolor, pub mHasColor: bool, pub mInset: bool, @@ -30209,33 +30232,16 @@ pub mod root { "Alignment of field: " , stringify ! ( nsCSSShadowArray ) , "::" , stringify ! ( mLength ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsCSSShadowArray ) ) . mArray as * const _ as usize } , 12usize , concat ! ( "Alignment of field: " , stringify ! ( nsCSSShadowArray ) , "::" , stringify ! ( mArray ) )); } - #[repr(C)] - #[derive(Debug)] - pub struct nsBorderColors { - pub mColors: [root::nsTArray<::std::os::raw::c_uint>; 4usize], - } - #[test] - fn bindgen_test_layout_nsBorderColors() { - assert_eq!(::std::mem::size_of::<nsBorderColors>() , 32usize , concat - ! ( "Size of: " , stringify ! ( nsBorderColors ) )); - assert_eq! (::std::mem::align_of::<nsBorderColors>() , 8usize , concat - ! ( "Alignment of " , stringify ! ( nsBorderColors ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsBorderColors ) ) . mColors as * - const _ as usize } , 0usize , concat ! ( - "Alignment of field: " , stringify ! ( nsBorderColors ) , - "::" , stringify ! ( mColors ) )); - } /// An object that allows sharing of arrays that store 'quotes' property /// values. This is particularly important for inheritance, where we want /// to share the same 'quotes' value with a parent style context. #[repr(C)] #[derive(Debug)] pub struct nsStyleQuoteValues { pub mRefCnt: root::mozilla::ThreadSafeAutoRefCnt, pub mQuotePairs: root::nsStyleQuoteValues_QuotePairArray, @@ -33094,38 +33100,16 @@ pub mod root { "Size of template specialization: " , stringify ! ( root::RefPtr<root::nsCSSValueSharedList> ) )); assert_eq!(::std::mem::align_of::<root::RefPtr<root::nsCSSValueSharedList>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root::RefPtr<root::nsCSSValueSharedList> ) )); } #[test] - fn __bindgen_test_layout_UniquePtr_open0_nsBorderColors_DefaultDelete_open1_nsBorderColors_close1_close0_instantiation() { - assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsBorderColors>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::UniquePtr<root::nsBorderColors> ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::UniquePtr<root::nsBorderColors>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::UniquePtr<root::nsBorderColors> ) )); - } - #[test] - fn __bindgen_test_layout_DefaultDelete_open0_nsBorderColors_close0_instantiation() { - assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - assert_eq!(::std::mem::align_of::<root::mozilla::DefaultDelete>() , - 1usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::DefaultDelete ) )); - } - #[test] fn __bindgen_test_layout_nsTArray_open0_nsStyleFilter_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsStyleFilter>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( root::nsTArray<root::nsStyleFilter> ) )); assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsStyleFilter>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( @@ -33171,27 +33155,16 @@ pub mod root { "Size of template specialization: " , stringify ! ( root::nsTArray<::nsstring::nsStringRepr> ) )); assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTString_open0_char16_t_close0_instantiation_2() { - assert_eq!(::std::mem::size_of::<::nsstring::nsStringRepr>() , 16usize , - concat ! ( - "Size of template specialization: " , stringify ! ( - ::nsstring::nsStringRepr ) )); - assert_eq!(::std::mem::align_of::<::nsstring::nsStringRepr>() , 8usize , - concat ! ( - "Alignment of template specialization: " , stringify ! ( - ::nsstring::nsStringRepr ) )); - } - #[test] fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_200130_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( root::nsTArray<*mut root::mozilla::StyleSheet> ) )); assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( @@ -34414,27 +34387,16 @@ pub mod root { "Size of template specialization: " , stringify ! ( root::nsTArray<::nsstring::nsStringRepr> ) )); assert_eq!(::std::mem::align_of::<root::nsTArray<::nsstring::nsStringRepr>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTString_open0_char16_t_close0_instantiation_3() { - assert_eq!(::std::mem::size_of::<::nsstring::nsStringRepr>() , 16usize , - concat ! ( - "Size of template specialization: " , stringify ! ( - ::nsstring::nsStringRepr ) )); - assert_eq!(::std::mem::align_of::<::nsstring::nsStringRepr>() , 8usize , - concat ! ( - "Alignment of template specialization: " , stringify ! ( - ::nsstring::nsStringRepr ) )); - } - #[test] fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_210857_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( root::nsTArray<*mut root::mozilla::StyleSheet> ) )); assert_eq!(::std::mem::align_of::<root::nsTArray<*mut root::mozilla::StyleSheet>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( @@ -36310,27 +36272,16 @@ pub mod root { )); assert_eq!(::std::mem::align_of::<root::nsStyleAutoArray<root::nsStyleImageLayers_Layer>>() , 8usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root::nsStyleAutoArray<root::nsStyleImageLayers_Layer> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0_unsigned_int_close0_instantiation_5() { - assert_eq!(::std::mem::size_of::<root::nsTArray<::std::os::raw::c_uint>>() - , 8usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::nsTArray<::std::os::raw::c_uint> ) )); - assert_eq!(::std::mem::align_of::<root::nsTArray<::std::os::raw::c_uint>>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::nsTArray<::std::os::raw::c_uint> ) )); - } - #[test] fn __bindgen_test_layout_nsTArray_open0_pair_open1_nsString_nsString_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::<root::nsTArray<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( root::nsTArray<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>> ) )); assert_eq!(::std::mem::align_of::<root::nsTArray<root::std::pair<::nsstring::nsStringRepr,
--- a/servo/components/style/properties/gecko.mako.rs +++ b/servo/components/style/properties/gecko.mako.rs @@ -1267,44 +1267,16 @@ fn static_assert() { <% skip_moz_border_color_longhands = " ".join("-moz-border-{0}-colors".format(x.ident) for x in SIDES) %> <%self:impl_trait style_struct_name="Border" skip_longhands="${skip_border_longhands} border-image-source border-image-outset border-image-repeat border-image-width border-image-slice ${skip_moz_border_color_longhands}"> - fn set_moz_border_colors(&mut self, side: structs::Side, v: Option<Vec<::cssparser::RGBA>>) { - match v { - None => { - let ptr = self.gecko.mBorderColors.mPtr; - if let Some(colors) = unsafe { ptr.as_mut() } { - unsafe { colors.mColors[side as usize].clear() }; - } - } - Some(ref colors) => { - unsafe { bindings::Gecko_EnsureMozBorderColors(&mut self.gecko) }; - let border_colors = unsafe { self.gecko.mBorderColors.mPtr.as_mut().unwrap() }; - let dest_colors = &mut border_colors.mColors[side as usize]; - unsafe { dest_colors.set_len_pod(colors.len() as u32) }; - for (dst, src) in dest_colors.iter_mut().zip(colors.into_iter()) { - *dst = convert_rgba_to_nscolor(src); - } - } - } - } - - fn clone_moz_border_colors(&self, side: structs::Side) -> Option<Vec<::cssparser::RGBA>> { - unsafe { self.gecko.mBorderColors.mPtr.as_ref() }.map(|colors| { - colors.mColors[side as usize].iter() - .map(|color| convert_nscolor_to_rgba(*color)) - .collect() - }) - } - % for side in SIDES: <% impl_keyword("border_%s_style" % side.ident, "mBorderStyle[%s]" % side.index, border_style_keyword, on_set="update_border_%s" % side.ident) %> // This is needed because the initial mComputedBorder value is set to zero. // @@ -1345,17 +1317,39 @@ fn static_assert() { pub fn border_${side.ident}_has_nonzero_width(&self) -> bool { self.gecko.mComputedBorder.${side.ident} != 0 } #[allow(non_snake_case)] pub fn set__moz_border_${side.ident}_colors(&mut self, v: longhands::_moz_border_${side.ident}_colors::computed_value::T) { - self.set_moz_border_colors(structs::Side::eSide${to_camel_case(side.ident)}, v.0); + match v.0 { + None => { + unsafe { + bindings::Gecko_ClearMozBorderColors(&mut self.gecko, + structs::Side::eSide${to_camel_case(side.ident)}); + } + }, + Some(ref colors) => { + unsafe { + bindings::Gecko_EnsureMozBorderColors(&mut self.gecko); + bindings::Gecko_ClearMozBorderColors(&mut self.gecko, + structs::Side::eSide${to_camel_case(side.ident)}); + } + for color in colors { + let c = convert_rgba_to_nscolor(color); + unsafe { + bindings::Gecko_AppendMozBorderColors(&mut self.gecko, + structs::Side::eSide${to_camel_case(side.ident)}, + c); + } + } + } + } } #[allow(non_snake_case)] pub fn copy__moz_border_${side.ident}_colors_from(&mut self, other: &Self) { unsafe { bindings::Gecko_CopyMozBorderColors(&mut self.gecko, &other.gecko, structs::Side::eSide${to_camel_case(side.ident)}); } @@ -1365,17 +1359,34 @@ fn static_assert() { pub fn reset__moz_border_${side.ident}_colors(&mut self, other: &Self) { self.copy__moz_border_${side.ident}_colors_from(other) } #[allow(non_snake_case)] pub fn clone__moz_border_${side.ident}_colors(&self) -> longhands::_moz_border_${side.ident}_colors::computed_value::T { use self::longhands::_moz_border_${side.ident}_colors::computed_value::T; - T(self.clone_moz_border_colors(structs::Side::eSide${to_camel_case(side.ident)})) + + let mut gecko_colors = + unsafe { bindings::Gecko_GetMozBorderColors(&self.gecko, + structs::Side::eSide${to_camel_case(side.ident)}) }; + + if gecko_colors.is_null() { + return T(None); + } + + let mut colors = Vec::new(); + loop { + unsafe { + colors.push(convert_nscolor_to_rgba((*gecko_colors).mColor)); + if (*gecko_colors).mNext.is_null() { break; } + gecko_colors = (*gecko_colors).mNext; + } + } + T(Some(colors)) } % endfor % for corner in CORNERS: <% impl_corner_style_coord("border_%s_radius" % corner.ident, "mBorderRadius", corner.x_index, corner.y_index) %>