mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
Use generics for the border-image-width property
This commit is contained in:
parent
7a214831f0
commit
c8eb277ca5
8 changed files with 115 additions and 189 deletions
|
@ -993,17 +993,17 @@ fn static_assert() {
|
|||
}
|
||||
|
||||
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;
|
||||
use values::generics::border::BorderImageWidthSide;
|
||||
|
||||
% for side in SIDES:
|
||||
match v.${side.index} {
|
||||
SingleComputedValue::Auto => {
|
||||
match v.${side.ident} {
|
||||
BorderImageWidthSide::Auto => {
|
||||
self.gecko.mBorderImageWidth.data_at_mut(${side.index}).set_value(CoordDataValue::Auto)
|
||||
},
|
||||
SingleComputedValue::LengthOrPercentage(l) => {
|
||||
BorderImageWidthSide::Length(l) => {
|
||||
l.to_gecko_style_coord(&mut self.gecko.mBorderImageWidth.data_at_mut(${side.index}))
|
||||
},
|
||||
SingleComputedValue::Number(n) => {
|
||||
BorderImageWidthSide::Number(n) => {
|
||||
self.gecko.mBorderImageWidth.data_at_mut(${side.index}).set_value(CoordDataValue::Factor(n))
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue