implements nsStyleBorder type properties animatable

This commit is contained in:
Daisuke Akatsuka 2017-07-05 13:00:49 +09:00
parent 0555977c66
commit 699ec02e8b
2 changed files with 25 additions and 1 deletions

View file

@ -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:

View file

@ -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">