diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index b82c1d94aec..eff22c710d7 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -1020,6 +1020,30 @@ fn static_assert() { structs::Side::eSide${to_camel_case(side.ident)}); } } + + #[allow(non_snake_case)] + pub fn clone__moz_border_${side.ident}_colors(&self) + -> longhands::_moz_border_${side.ident}_colors::computed_value::T { + use self::longhands::_moz_border_${side.ident}_colors::computed_value::T; + + let mut gecko_colors = + unsafe { bindings::Gecko_GetMozBorderColors(&self.gecko, + structs::Side::eSide${to_camel_case(side.ident)}) }; + + if gecko_colors.is_null() { + return T(None); + } + + let mut colors = Vec::new(); + loop { + unsafe { + colors.push(convert_nscolor_to_rgba((*gecko_colors).mColor)); + if (*gecko_colors).mNext.is_null() { break; } + gecko_colors = (*gecko_colors).mNext; + } + } + T(Some(colors)) + } % endfor % for corner in CORNERS: diff --git a/components/style/properties/longhand/border.mako.rs b/components/style/properties/longhand/border.mako.rs index ea68b59c887..f3b3642382d 100644 --- a/components/style/properties/longhand/border.mako.rs +++ b/components/style/properties/longhand/border.mako.rs @@ -60,7 +60,7 @@ ${helpers.gecko_keyword_conversion(Keyword('border-style', /// -moz-border-*-colors: color, string, enum, none, inherit/initial /// These non-spec properties are just for Gecko (Stylo) internal use. % for side in PHYSICAL_SIDES: - <%helpers:longhand name="-moz-border-${side}-colors" animation_value_type="none" + <%helpers:longhand name="-moz-border-${side}-colors" animation_value_type="discrete" spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-border-*-colors)" products="gecko" ignored_when_colors_disabled="True">