diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 8c629bc44ce..21e0c8d75fc 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -2205,8 +2205,7 @@ fn static_assert() { transition-timing-function transition-property transform-style scroll-snap-points-x scroll-snap-points-y scroll-snap-coordinate - -moz-binding offset-path shape-outside - -webkit-line-clamp""" %> + -moz-binding 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) { @@ -2513,39 +2512,6 @@ fn static_assert() { <% impl_shape_source("shape_outside", "mShapeOutside") %> - pub fn set_offset_path(&mut self, v: longhands::offset_path::computed_value::T) { - use crate::gecko_bindings::bindings::{Gecko_NewStyleMotion, Gecko_SetStyleMotion}; - use crate::gecko_bindings::structs::StyleShapeSourceType; - use crate::values::generics::basic_shape::FillRule; - use crate::values::specified::OffsetPath; - - let motion = unsafe { Gecko_NewStyleMotion().as_mut().unwrap() }; - match v { - OffsetPath::None => motion.mOffsetPath.mType = StyleShapeSourceType::None, - OffsetPath::Path(p) => { - set_style_svg_path(&mut motion.mOffsetPath, p, FillRule::Nonzero) - }, - } - unsafe { Gecko_SetStyleMotion(&mut self.gecko.mMotion, motion) }; - } - - pub fn clone_offset_path(&self) -> longhands::offset_path::computed_value::T { - use crate::values::specified::OffsetPath; - match unsafe { self.gecko.mMotion.mPtr.as_ref() } { - None => OffsetPath::none(), - Some(v) => (&v.mOffsetPath).into() - } - } - - pub fn copy_offset_path_from(&mut self, other: &Self) { - use crate::gecko_bindings::bindings::Gecko_CopyStyleMotions; - unsafe { Gecko_CopyStyleMotions(&mut self.gecko.mMotion, other.gecko.mMotion.mPtr) }; - } - - pub fn reset_offset_path(&mut self, other: &Self) { - self.copy_offset_path_from(other); - } - #[allow(non_snake_case)] pub fn set__webkit_line_clamp(&mut self, v: longhands::_webkit_line_clamp::computed_value::T) { self.gecko.mLineClamp = match v { diff --git a/components/style/values/specified/motion.rs b/components/style/values/specified/motion.rs index 7d72796397e..73072ac6199 100644 --- a/components/style/values/specified/motion.rs +++ b/components/style/values/specified/motion.rs @@ -12,6 +12,7 @@ use style_traits::{ParseError, StyleParseErrorKind}; /// The offset-path value. /// /// https://drafts.fxtf.org/motion-1/#offset-path-property +/// cbindgen:derive-tagged-enum-copy-constructor=true #[derive( Animate, Clone, @@ -26,6 +27,7 @@ use style_traits::{ParseError, StyleParseErrorKind}; ToResolvedValue, ToShmem, )] +#[repr(C, u8)] pub enum OffsetPath { // We could merge SVGPathData into ShapeSource, so we could reuse them. However, // we don't want to support other value for offset-path, so use SVGPathData only for now.