diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index e99dc303457..c453bfae688 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -3808,6 +3808,26 @@ clip-path bindings::Gecko_nsStyleSVG_CopyDashArray(&mut self.gecko, &other.gecko); } } + + pub fn clone_stroke_dasharray(&self) -> longhands::stroke_dasharray::computed_value::T { + use smallvec::SmallVec; + use values::computed::LengthOrPercentage; + + let mut vec = SmallVec::new(); + for gecko in self.gecko.mStrokeDasharray.iter() { + match gecko.as_value() { + CoordDataValue::Factor(number) => vec.push(Either::First(number)), + CoordDataValue::Coord(coord) => + vec.push(Either::Second(LengthOrPercentage::Length(Au(coord)))), + CoordDataValue::Percent(p) => + vec.push(Either::Second(LengthOrPercentage::Percentage(p))), + CoordDataValue::Calc(calc) => + vec.push(Either::Second(LengthOrPercentage::Calc(calc.into()))), + _ => unreachable!(), + } + } + longhands::stroke_dasharray::computed_value::T(vec) + } <%self:impl_trait style_struct_name="Color" diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 1b2e8f456c3..8767f78102f 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -621,6 +621,8 @@ pub trait Interpolate: Sized { /// https://drafts.csswg.org/css-transitions/#animtype-repeatable-list pub trait RepeatableListInterpolate: Interpolate {} +impl RepeatableListInterpolate for Either {} + impl Interpolate for SmallVec<[T; 1]> { fn interpolate(&self, other: &Self, progress: f64) -> Result { use num_integer::lcm; diff --git a/components/style/properties/longhand/inherited_svg.mako.rs b/components/style/properties/longhand/inherited_svg.mako.rs index 068c3d127f6..33cda168d50 100644 --- a/components/style/properties/longhand/inherited_svg.mako.rs +++ b/components/style/properties/longhand/inherited_svg.mako.rs @@ -74,20 +74,20 @@ ${helpers.predefined_type( spec="https://www.w3.org/TR/SVG2/painting.html#StrokeWidth")} ${helpers.single_keyword("stroke-linecap", "butt round square", - products="gecko", animation_value_type="none", + products="gecko", animation_value_type="discrete", spec="https://www.w3.org/TR/SVG11/painting.html#StrokeLinecapProperty")} ${helpers.single_keyword("stroke-linejoin", "miter round bevel", - products="gecko", animation_value_type="none", + products="gecko", animation_value_type="discrete", spec="https://www.w3.org/TR/SVG11/painting.html#StrokeLinejoinProperty")} ${helpers.predefined_type("stroke-miterlimit", "Number", "4.0", "parse_at_least_one", products="gecko", - animation_value_type="none", + animation_value_type="ComputedValue", spec="https://www.w3.org/TR/SVG11/painting.html#StrokeMiterlimitProperty")} ${helpers.predefined_type("stroke-opacity", "Opacity", "1.0", - products="gecko", animation_value_type="none", + products="gecko", animation_value_type="ComputedValue", spec="https://www.w3.org/TR/SVG11/painting.html#StrokeOpacityProperty")} ${helpers.predefined_type("stroke-dasharray", @@ -95,9 +95,10 @@ ${helpers.predefined_type("stroke-dasharray", "Either::First(0.0)", "parse_non_negative", vector="True", + delegate_animate="True", allow_empty="True", products="gecko", - animation_value_type="none", + animation_value_type="ComputedValue", space_separated_allowed="True", spec="https://www.w3.org/TR/SVG2/painting.html#StrokeDashing")}