mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Format remaining files
This commit is contained in:
parent
bf47f90da6
commit
cb07debcb6
252 changed files with 5944 additions and 3744 deletions
|
@ -13,31 +13,60 @@ use style_traits::ToCss;
|
|||
|
||||
macro_rules! assert_longhand {
|
||||
($parsed_shorthand: expr, $prop: ident, $value_string: expr) => {
|
||||
assert_eq!($parsed_shorthand.$prop, parse_longhand!($prop, $value_string).maybe_boxed())
|
||||
}
|
||||
assert_eq!(
|
||||
$parsed_shorthand.$prop,
|
||||
parse_longhand!($prop, $value_string).maybe_boxed()
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
macro_rules! assert_initial {
|
||||
($parsed_shorthand: expr, $prop: ident) => {
|
||||
assert_eq!($parsed_shorthand.$prop, $prop::get_initial_specified_value().maybe_boxed())
|
||||
}
|
||||
assert_eq!(
|
||||
$parsed_shorthand.$prop,
|
||||
$prop::get_initial_specified_value().maybe_boxed()
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
macro_rules! assert_border_radius_values {
|
||||
($input:expr; $tlw:expr, $trw:expr, $brw:expr, $blw:expr ;
|
||||
$tlh:expr, $trh:expr, $brh:expr, $blh:expr) => {
|
||||
let input = parse(BorderRadius::parse, $input)
|
||||
.expect(&format!("Failed parsing {} as border radius",
|
||||
$input));
|
||||
assert_eq!(::style_traits::ToCss::to_css_string(&input.top_left.0.width()), $tlw);
|
||||
assert_eq!(::style_traits::ToCss::to_css_string(&input.top_right.0.width()), $trw);
|
||||
assert_eq!(::style_traits::ToCss::to_css_string(&input.bottom_right.0.width()), $brw);
|
||||
assert_eq!(::style_traits::ToCss::to_css_string(&input.bottom_left.0.width()), $blw);
|
||||
assert_eq!(::style_traits::ToCss::to_css_string(&input.top_left.0.height()), $tlh);
|
||||
assert_eq!(::style_traits::ToCss::to_css_string(&input.top_right.0.height()), $trh);
|
||||
assert_eq!(::style_traits::ToCss::to_css_string(&input.bottom_right.0.height()), $brh);
|
||||
assert_eq!(::style_traits::ToCss::to_css_string(&input.bottom_left.0.height()), $blh);
|
||||
}
|
||||
.expect(&format!("Failed parsing {} as border radius", $input));
|
||||
assert_eq!(
|
||||
::style_traits::ToCss::to_css_string(&input.top_left.0.width()),
|
||||
$tlw
|
||||
);
|
||||
assert_eq!(
|
||||
::style_traits::ToCss::to_css_string(&input.top_right.0.width()),
|
||||
$trw
|
||||
);
|
||||
assert_eq!(
|
||||
::style_traits::ToCss::to_css_string(&input.bottom_right.0.width()),
|
||||
$brw
|
||||
);
|
||||
assert_eq!(
|
||||
::style_traits::ToCss::to_css_string(&input.bottom_left.0.width()),
|
||||
$blw
|
||||
);
|
||||
assert_eq!(
|
||||
::style_traits::ToCss::to_css_string(&input.top_left.0.height()),
|
||||
$tlh
|
||||
);
|
||||
assert_eq!(
|
||||
::style_traits::ToCss::to_css_string(&input.top_right.0.height()),
|
||||
$trh
|
||||
);
|
||||
assert_eq!(
|
||||
::style_traits::ToCss::to_css_string(&input.bottom_right.0.height()),
|
||||
$brh
|
||||
);
|
||||
assert_eq!(
|
||||
::style_traits::ToCss::to_css_string(&input.bottom_left.0.height()),
|
||||
$blh
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue