diff options
author | Nazım Can Altınova <canaltinova@gmail.com> | 2016-11-03 18:42:38 +0300 |
---|---|---|
committer | Nazım Can Altınova <canaltinova@gmail.com> | 2016-11-06 20:08:24 +0300 |
commit | 8387d7e8b6fbebf2fa8aa00212a59e4fc6665dbb (patch) | |
tree | 2c5f7c17450e926bda2759f0a3eff7dcf50300c3 | |
parent | cbd43f7acc3466f26ff978af666d851c89d1b661 (diff) | |
download | servo-8387d7e8b6fbebf2fa8aa00212a59e4fc6665dbb.tar.gz servo-8387d7e8b6fbebf2fa8aa00212a59e4fc6665dbb.zip |
Implement gecko glue for border-image-width
-rw-r--r-- | components/style/properties/gecko.mako.rs | 28 | ||||
-rw-r--r-- | components/style/properties/longhand/border.mako.rs | 2 |
2 files changed, 28 insertions, 2 deletions
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 7514cbff90d..287dfe7d20d 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -640,7 +640,8 @@ 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 border-image-outset border-image-repeat" + skip_longhands="${skip_border_longhands} border-image-source border-image-outset + border-image-repeat border-image-width" skip_additionals="*"> % for side in SIDES: @@ -725,6 +726,31 @@ fn static_assert() { self.gecko.mBorderImageRepeatH = other.gecko.mBorderImageRepeatH; self.gecko.mBorderImageRepeatV = other.gecko.mBorderImageRepeatV; } + + pub fn set_border_image_width(&mut self, v: longhands::border_image_width::computed_value::T) { + use properties::longhands::border_image_width::computed_value::SingleComputedValue; + + % for side in SIDES: + match v.${side.index} { + SingleComputedValue::Auto => { + self.gecko.mBorderImageWidth.data_at_mut(${side.index}).set_value(CoordDataValue::Auto) + }, + SingleComputedValue::LengthOrPercentage(l) => { + l.to_gecko_style_coord(&mut self.gecko.mBorderImageWidth.data_at_mut(${side.index})) + }, + SingleComputedValue::Number(n) => { + self.gecko.mBorderImageWidth.data_at_mut(${side.index}).set_value(CoordDataValue::Factor(n)) + }, + } + % endfor + } + + pub fn copy_border_image_width_from(&mut self, other: &Self) { + % for side in SIDES: + self.gecko.mBorderImageWidth.data_at_mut(${side.index}) + .copy_from(&other.gecko.mBorderImageWidth.data_at(${side.index})); + % endfor + } </%self:impl_trait> <% 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 703eb991604..597a5c2fda8 100644 --- a/components/style/properties/longhand/border.mako.rs +++ b/components/style/properties/longhand/border.mako.rs @@ -383,7 +383,7 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box", </%helpers:longhand> // https://drafts.csswg.org/css-backgrounds-3/#border-image-width -<%helpers:longhand name="border-image-width" products="none" animatable="False"> +<%helpers:longhand name="border-image-width" products="gecko" animatable="False"> use cssparser::ToCss; use std::fmt; use values::LocalToCss; |