Implement gecko glue for border-image-outset

This commit is contained in:
Nazım Can Altınova 2016-11-02 23:50:48 +03:00
parent 132b36835b
commit dc55e80752
2 changed files with 22 additions and 2 deletions

View file

@ -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
}
</%self:impl_trait>
<% skip_margin_longhands = " ".join(["margin-%s" % x.ident for x in SIDES]) %>

View file

@ -137,7 +137,8 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box",
}
</%helpers:longhand>
<%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;