diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 351c8790eb3..24e15a1e1a3 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -640,7 +640,7 @@ fn static_assert() { ["border-{0}-radius".format(x.ident.replace("_", "-")) for x in CORNERS]) %> <%self:impl_trait style_struct_name="Border" - skip_longhands="${skip_border_longhands} border-image-source" + skip_longhands="${skip_border_longhands} border-image-source border-image-outset" skip_additionals="*"> % for side in SIDES: @@ -684,6 +684,25 @@ fn static_assert() { &other.gecko.mBorderImageSource); } } + + pub fn set_border_image_outset(&mut self, v: longhands::border_image_outset::computed_value::T) { + use properties::longhands::border_image_outset::computed_value::LengthOrNumber; + % for side in SIDES: + match v.${side.index} { + LengthOrNumber::Length(l) => + l.to_gecko_style_coord(&mut self.gecko.mBorderImageOutset.data_at_mut(${side.index})), + LengthOrNumber::Number(n) => + self.gecko.mBorderImageOutset.data_at_mut(${side.index}).set_value(CoordDataValue::Factor(n)), + } + % endfor + } + + pub fn copy_border_image_outset_from(&mut self, other: &Self) { + % for side in SIDES: + self.gecko.mBorderImageOutset.data_at_mut(${side.index}) + .copy_from(&other.gecko.mBorderImageOutset.data_at(${side.index})); + % endfor + } <% skip_margin_longhands = " ".join(["margin-%s" % x.ident for x in SIDES]) %> diff --git a/components/style/properties/longhand/border.mako.rs b/components/style/properties/longhand/border.mako.rs index c9f62a87f79..eb55e539e9d 100644 --- a/components/style/properties/longhand/border.mako.rs +++ b/components/style/properties/longhand/border.mako.rs @@ -137,7 +137,8 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box", } -<%helpers:longhand name="border-image-outset" products="none" animatable="False"> +// https://drafts.csswg.org/css-backgrounds-3/#border-image-outset +<%helpers:longhand name="border-image-outset" products="gecko" animatable="False"> use cssparser::ToCss; use std::fmt; use values::LocalToCss;