mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Implement gecko glue for border-image-width
This commit is contained in:
parent
cbd43f7acc
commit
8387d7e8b6
2 changed files with 28 additions and 2 deletions
|
@ -640,7 +640,8 @@ fn static_assert() {
|
||||||
["border-{0}-radius".format(x.ident.replace("_", "-"))
|
["border-{0}-radius".format(x.ident.replace("_", "-"))
|
||||||
for x in CORNERS]) %>
|
for x in CORNERS]) %>
|
||||||
<%self:impl_trait style_struct_name="Border"
|
<%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="*">
|
skip_additionals="*">
|
||||||
|
|
||||||
% for side in SIDES:
|
% for side in SIDES:
|
||||||
|
@ -725,6 +726,31 @@ fn static_assert() {
|
||||||
self.gecko.mBorderImageRepeatH = other.gecko.mBorderImageRepeatH;
|
self.gecko.mBorderImageRepeatH = other.gecko.mBorderImageRepeatH;
|
||||||
self.gecko.mBorderImageRepeatV = other.gecko.mBorderImageRepeatV;
|
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>
|
</%self:impl_trait>
|
||||||
|
|
||||||
<% skip_margin_longhands = " ".join(["margin-%s" % x.ident for x in SIDES]) %>
|
<% skip_margin_longhands = " ".join(["margin-%s" % x.ident for x in SIDES]) %>
|
||||||
|
|
|
@ -383,7 +383,7 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box",
|
||||||
</%helpers:longhand>
|
</%helpers:longhand>
|
||||||
|
|
||||||
// https://drafts.csswg.org/css-backgrounds-3/#border-image-width
|
// 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 cssparser::ToCss;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use values::LocalToCss;
|
use values::LocalToCss;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue