diff --git a/components/style/build_gecko.rs b/components/style/build_gecko.rs index de60fe615bef..8f3d04399225 100644 --- a/components/style/build_gecko.rs +++ b/components/style/build_gecko.rs @@ -391,8 +391,8 @@ mod bindings { "StyleAnimation", "StyleBasicShape", "StyleBasicShapeType", - "StyleClipPath", "StyleGeometryBox", + "StyleShapeSource", "StyleTransition", "mozilla::UniquePtr", "mozilla::DefaultDelete", @@ -531,7 +531,7 @@ mod bindings { "SheetParsingMode", "StyleBasicShape", "StyleBasicShapeType", - "StyleClipPath", + "StyleShapeSource", "nsCSSKeyword", "nsCSSPropertyID", "nsCSSShadowArray", diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs index d1c85feefa71..5ee54e51383e 100644 --- a/components/style/gecko_bindings/bindings.rs +++ b/components/style/gecko_bindings/bindings.rs @@ -26,7 +26,7 @@ use gecko_bindings::structs::ServoElementSnapshot; use gecko_bindings::structs::SheetParsingMode; use gecko_bindings::structs::StyleBasicShape; use gecko_bindings::structs::StyleBasicShapeType; -use gecko_bindings::structs::StyleClipPath; +use gecko_bindings::structs::StyleShapeSource; use gecko_bindings::structs::nsCSSKeyword; use gecko_bindings::structs::nsCSSPropertyID; use gecko_bindings::structs::nsCSSShadowArray; @@ -691,18 +691,18 @@ extern "C" { calc: nsStyleCoord_CalcValue); } extern "C" { - pub fn Gecko_CopyClipPathValueFrom(dst: *mut StyleClipPath, - src: *const StyleClipPath); + pub fn Gecko_CopyClipPathValueFrom(dst: *mut StyleShapeSource, + src: *const StyleShapeSource); } extern "C" { - pub fn Gecko_DestroyClipPath(clip: *mut StyleClipPath); + pub fn Gecko_DestroyClipPath(clip: *mut StyleShapeSource); } extern "C" { pub fn Gecko_NewBasicShape(type_: StyleBasicShapeType) -> *mut StyleBasicShape; } extern "C" { - pub fn Gecko_StyleClipPath_SetURLValue(clip: *mut StyleClipPath, + pub fn Gecko_StyleClipPath_SetURLValue(clip: *mut StyleShapeSource, uri: ServoBundledURI); } extern "C" { diff --git a/components/style/gecko_bindings/structs_debug.rs b/components/style/gecko_bindings/structs_debug.rs index 1211c87ce240..91e162f886ec 100644 --- a/components/style/gecko_bindings/structs_debug.rs +++ b/components/style/gecko_bindings/structs_debug.rs @@ -5719,15 +5719,6 @@ pub mod root { pub enum StyleHyphens { None = 0, Manual = 1, Auto = 2, } #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum StyleShapeOutsideShapeBox { - NoBox = 0, - Content = 1, - Padding = 2, - Border = 3, - Margin = 4, - } - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StyleShapeRadius { ClosestSide = 0, FarthestSide = 1, } #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -7013,23 +7004,66 @@ pub mod root { } #[repr(C)] #[derive(Debug)] - pub struct StyleShapeSource { - pub __bindgen_anon_1: root::mozilla::StyleShapeSource__bindgen_ty_1, + pub struct StyleShapeSource { + pub __bindgen_anon_1: root::mozilla::StyleShapeSource__bindgen_ty_1, pub mType: root::mozilla::StyleShapeSourceType, - pub mReferenceBox: ReferenceBox, + pub mReferenceBox: root::mozilla::StyleGeometryBox, } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct StyleShapeSource__bindgen_ty_1 { + #[derive(Debug, Copy)] + pub struct StyleShapeSource__bindgen_ty_1 { pub mBasicShape: root::__BindgenUnionField<*mut root::mozilla::StyleBasicShape>, pub mURL: root::__BindgenUnionField<*mut root::mozilla::css::URLValue>, pub bindgen_union_field: u64, - pub _phantom_0: ::std::marker::PhantomData, } - pub type StyleClipPath = - root::mozilla::StyleShapeSource; - pub type StyleShapeOutside = - root::mozilla::StyleShapeSource; + #[test] + fn bindgen_test_layout_StyleShapeSource__bindgen_ty_1() { + assert_eq!(::std::mem::size_of::() + , 8usize , concat ! ( + "Size of: " , stringify ! ( + StyleShapeSource__bindgen_ty_1 ) )); + assert_eq! (::std::mem::align_of::() + , 8usize , concat ! ( + "Alignment of " , stringify ! ( + StyleShapeSource__bindgen_ty_1 ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const StyleShapeSource__bindgen_ty_1 ) + ) . mBasicShape as * const _ as usize } , 0usize , + concat ! ( + "Alignment of field: " , stringify ! ( + StyleShapeSource__bindgen_ty_1 ) , "::" , stringify ! + ( mBasicShape ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const StyleShapeSource__bindgen_ty_1 ) + ) . mURL as * const _ as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( + StyleShapeSource__bindgen_ty_1 ) , "::" , stringify ! + ( mURL ) )); + } + impl Clone for StyleShapeSource__bindgen_ty_1 { + fn clone(&self) -> Self { *self } + } + #[test] + fn bindgen_test_layout_StyleShapeSource() { + assert_eq!(::std::mem::size_of::() , 16usize , + concat ! ( + "Size of: " , stringify ! ( StyleShapeSource ) )); + assert_eq! (::std::mem::align_of::() , 8usize , + concat ! ( + "Alignment of " , stringify ! ( StyleShapeSource ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const StyleShapeSource ) ) . mType as * + const _ as usize } , 8usize , concat ! ( + "Alignment of field: " , stringify ! ( + StyleShapeSource ) , "::" , stringify ! ( mType ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const StyleShapeSource ) ) . + mReferenceBox as * const _ as usize } , 9usize , + concat ! ( + "Alignment of field: " , stringify ! ( + StyleShapeSource ) , "::" , stringify ! ( + mReferenceBox ) )); + } /** * A property-value pair specified on a keyframe. */ @@ -21284,7 +21318,7 @@ pub mod root { pub mAnimationFillModeCount: u32, pub mAnimationPlayStateCount: u32, pub mAnimationIterationCountCount: u32, - pub mShapeOutside: root::mozilla::StyleShapeOutside, + pub mShapeOutside: root::mozilla::StyleShapeSource, } #[test] fn bindgen_test_layout_nsStyleDisplay() { @@ -24961,7 +24995,7 @@ pub mod root { #[derive(Debug)] pub struct nsStyleSVGReset { pub mMask: root::nsStyleImageLayers, - pub mClipPath: root::mozilla::StyleClipPath, + pub mClipPath: root::mozilla::StyleShapeSource, pub mStopColor: root::nscolor, pub mFloodColor: root::nscolor, pub mLightingColor: root::nscolor, @@ -27021,32 +27055,6 @@ pub mod root { } #[test] fn __bindgen_test_layout_template_98() { - assert_eq!(::std::mem::size_of::>() - , 16usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::StyleShapeSource - ) )); - assert_eq!(::std::mem::align_of::>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::StyleShapeSource - ) )); - } - #[test] - fn __bindgen_test_layout_template_99() { - assert_eq!(::std::mem::size_of::>() - , 16usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::StyleShapeSource - ) )); - assert_eq!(::std::mem::align_of::>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::StyleShapeSource - ) )); - } - #[test] - fn __bindgen_test_layout_template_100() { assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -27057,7 +27065,7 @@ pub mod root { [u64; 18usize] ) )); } #[test] - fn __bindgen_test_layout_template_101() { + fn __bindgen_test_layout_template_99() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -27070,7 +27078,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_template_102() { + fn __bindgen_test_layout_template_100() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -27081,7 +27089,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_template_103() { + fn __bindgen_test_layout_template_101() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -27090,7 +27098,7 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout_template_104() { + fn __bindgen_test_layout_template_102() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( diff --git a/components/style/gecko_bindings/structs_release.rs b/components/style/gecko_bindings/structs_release.rs index 92c5f4693fc2..de388a947ef3 100644 --- a/components/style/gecko_bindings/structs_release.rs +++ b/components/style/gecko_bindings/structs_release.rs @@ -5559,15 +5559,6 @@ pub mod root { pub enum StyleHyphens { None = 0, Manual = 1, Auto = 2, } #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum StyleShapeOutsideShapeBox { - NoBox = 0, - Content = 1, - Padding = 2, - Border = 3, - Margin = 4, - } - #[repr(u8)] - #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StyleShapeRadius { ClosestSide = 0, FarthestSide = 1, } #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -6826,23 +6817,66 @@ pub mod root { } #[repr(C)] #[derive(Debug)] - pub struct StyleShapeSource { - pub __bindgen_anon_1: root::mozilla::StyleShapeSource__bindgen_ty_1, + pub struct StyleShapeSource { + pub __bindgen_anon_1: root::mozilla::StyleShapeSource__bindgen_ty_1, pub mType: root::mozilla::StyleShapeSourceType, - pub mReferenceBox: ReferenceBox, + pub mReferenceBox: root::mozilla::StyleGeometryBox, } #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct StyleShapeSource__bindgen_ty_1 { + #[derive(Debug, Copy)] + pub struct StyleShapeSource__bindgen_ty_1 { pub mBasicShape: root::__BindgenUnionField<*mut root::mozilla::StyleBasicShape>, pub mURL: root::__BindgenUnionField<*mut root::mozilla::css::URLValue>, pub bindgen_union_field: u64, - pub _phantom_0: ::std::marker::PhantomData, } - pub type StyleClipPath = - root::mozilla::StyleShapeSource; - pub type StyleShapeOutside = - root::mozilla::StyleShapeSource; + #[test] + fn bindgen_test_layout_StyleShapeSource__bindgen_ty_1() { + assert_eq!(::std::mem::size_of::() + , 8usize , concat ! ( + "Size of: " , stringify ! ( + StyleShapeSource__bindgen_ty_1 ) )); + assert_eq! (::std::mem::align_of::() + , 8usize , concat ! ( + "Alignment of " , stringify ! ( + StyleShapeSource__bindgen_ty_1 ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const StyleShapeSource__bindgen_ty_1 ) + ) . mBasicShape as * const _ as usize } , 0usize , + concat ! ( + "Alignment of field: " , stringify ! ( + StyleShapeSource__bindgen_ty_1 ) , "::" , stringify ! + ( mBasicShape ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const StyleShapeSource__bindgen_ty_1 ) + ) . mURL as * const _ as usize } , 0usize , concat ! ( + "Alignment of field: " , stringify ! ( + StyleShapeSource__bindgen_ty_1 ) , "::" , stringify ! + ( mURL ) )); + } + impl Clone for StyleShapeSource__bindgen_ty_1 { + fn clone(&self) -> Self { *self } + } + #[test] + fn bindgen_test_layout_StyleShapeSource() { + assert_eq!(::std::mem::size_of::() , 16usize , + concat ! ( + "Size of: " , stringify ! ( StyleShapeSource ) )); + assert_eq! (::std::mem::align_of::() , 8usize , + concat ! ( + "Alignment of " , stringify ! ( StyleShapeSource ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const StyleShapeSource ) ) . mType as * + const _ as usize } , 8usize , concat ! ( + "Alignment of field: " , stringify ! ( + StyleShapeSource ) , "::" , stringify ! ( mType ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const StyleShapeSource ) ) . + mReferenceBox as * const _ as usize } , 9usize , + concat ! ( + "Alignment of field: " , stringify ! ( + StyleShapeSource ) , "::" , stringify ! ( + mReferenceBox ) )); + } /** * A property-value pair specified on a keyframe. */ @@ -20683,7 +20717,7 @@ pub mod root { pub mAnimationFillModeCount: u32, pub mAnimationPlayStateCount: u32, pub mAnimationIterationCountCount: u32, - pub mShapeOutside: root::mozilla::StyleShapeOutside, + pub mShapeOutside: root::mozilla::StyleShapeSource, } #[test] fn bindgen_test_layout_nsStyleDisplay() { @@ -24359,7 +24393,7 @@ pub mod root { #[derive(Debug)] pub struct nsStyleSVGReset { pub mMask: root::nsStyleImageLayers, - pub mClipPath: root::mozilla::StyleClipPath, + pub mClipPath: root::mozilla::StyleShapeSource, pub mStopColor: root::nscolor, pub mFloodColor: root::nscolor, pub mLightingColor: root::nscolor, @@ -26419,32 +26453,6 @@ pub mod root { } #[test] fn __bindgen_test_layout_template_98() { - assert_eq!(::std::mem::size_of::>() - , 16usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::StyleShapeSource - ) )); - assert_eq!(::std::mem::align_of::>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::StyleShapeSource - ) )); - } - #[test] - fn __bindgen_test_layout_template_99() { - assert_eq!(::std::mem::size_of::>() - , 16usize , concat ! ( - "Size of template specialization: " , stringify ! ( - root::mozilla::StyleShapeSource - ) )); - assert_eq!(::std::mem::align_of::>() - , 8usize , concat ! ( - "Alignment of template specialization: " , stringify ! ( - root::mozilla::StyleShapeSource - ) )); - } - #[test] - fn __bindgen_test_layout_template_100() { assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -26455,7 +26463,7 @@ pub mod root { [u64; 18usize] ) )); } #[test] - fn __bindgen_test_layout_template_101() { + fn __bindgen_test_layout_template_99() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -26468,7 +26476,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_template_102() { + fn __bindgen_test_layout_template_100() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -26479,7 +26487,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_template_103() { + fn __bindgen_test_layout_template_101() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( u64 ) )); @@ -26488,7 +26496,7 @@ pub mod root { u64 ) )); } #[test] - fn __bindgen_test_layout_template_104() { + fn __bindgen_test_layout_template_102() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 88766d34fe6b..d34e35268b4c 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -2761,7 +2761,7 @@ clip-path use gecko_bindings::bindings::{Gecko_NewBasicShape, Gecko_DestroyClipPath}; use gecko_bindings::structs::StyleGeometryBox; use gecko_bindings::structs::{StyleBasicShape, StyleBasicShapeType, StyleShapeSourceType}; - use gecko_bindings::structs::{StyleClipPath, StyleFillRule}; + use gecko_bindings::structs::{StyleFillRule, StyleShapeSource}; use gecko::conversions::basic_shape::set_corners_from_radius; use gecko::values::GeckoStyleCoordConvertible; use values::computed::basic_shape::*; @@ -2789,7 +2789,7 @@ clip-path .unwrap_or(StyleGeometryBox::NoBox); clip_path.mType = StyleShapeSourceType::Shape; - fn init_shape(clip_path: &mut StyleClipPath, ty: StyleBasicShapeType) -> &mut StyleBasicShape { + fn init_shape(clip_path: &mut StyleShapeSource, ty: StyleBasicShapeType) -> &mut StyleBasicShape { unsafe { // We have to be very careful to avoid a copy here! let ref mut union = clip_path.__bindgen_anon_1;