diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 84dc8436940..ba9c4975851 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -53,7 +53,6 @@ use crate::values::computed::BorderStyle; use crate::values::computed::font::FontSize; use crate::values::generics::column::ColumnCount; use crate::values::generics::image::ImageLayer; -use crate::values::generics::transform::TransformStyle; use crate::values::generics::url::UrlOrNone; @@ -1473,7 +1472,7 @@ fn static_assert() { animation-iteration-count animation-timing-function clear transition-duration transition-delay transition-timing-function transition-property - transform-style shape-outside -webkit-line-clamp""" %> + shape-outside -webkit-line-clamp""" %> <%self:impl_trait style_struct_name="Box" skip_longhands="${skip_box_longhands}"> #[inline] pub fn set_display(&mut self, v: longhands::display::computed_value::T) { @@ -1630,25 +1629,6 @@ fn static_assert() { self.copy_transition_property_from(other) } - // Hand-written because the Mako helpers transform `Preserve3d` into `PRESERVE3D`. - pub fn set_transform_style(&mut self, v: TransformStyle) { - self.gecko.mTransformStyle = match v { - TransformStyle::Flat => structs::NS_STYLE_TRANSFORM_STYLE_FLAT as u8, - TransformStyle::Preserve3d => structs::NS_STYLE_TRANSFORM_STYLE_PRESERVE_3D as u8, - }; - } - - // Hand-written because the Mako helpers transform `Preserve3d` into `PRESERVE3D`. - pub fn clone_transform_style(&self) -> TransformStyle { - match self.gecko.mTransformStyle as u32 { - structs::NS_STYLE_TRANSFORM_STYLE_FLAT => TransformStyle::Flat, - structs::NS_STYLE_TRANSFORM_STYLE_PRESERVE_3D => TransformStyle::Preserve3d, - _ => panic!("illegal transform style"), - } - } - - ${impl_simple_copy('transform_style', 'mTransformStyle')} - ${impl_transition_count('property', 'Property')} pub fn animations_equals(&self, other: &Self) -> bool { diff --git a/components/style/properties/longhands/box.mako.rs b/components/style/properties/longhands/box.mako.rs index 554699e1862..18772fa0164 100644 --- a/components/style/properties/longhands/box.mako.rs +++ b/components/style/properties/longhands/box.mako.rs @@ -592,7 +592,7 @@ ${helpers.single_keyword( ${helpers.predefined_type( "transform-style", "TransformStyle", - "computed::TransformStyle::" + ("Flat" if engine == "gecko" else "Auto"), + "computed::TransformStyle::Flat", engines="gecko servo-2013 servo-2020", servo_2020_pref="layout.2020.unimplemented", spec="https://drafts.csswg.org/css-transforms-2/#transform-style-property", diff --git a/components/style/values/generics/transform.rs b/components/style/values/generics/transform.rs index 6583f9ebe10..26e54ab8df4 100644 --- a/components/style/values/generics/transform.rs +++ b/components/style/values/generics/transform.rs @@ -820,9 +820,8 @@ pub use self::GenericTranslate as Translate; ToResolvedValue, ToShmem, )] +#[repr(u8)] pub enum TransformStyle { - #[cfg(feature = "servo")] - Auto, Flat, #[css(keyword = "preserve-3d")] Preserve3d,