mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
Replace Au with CSSPixelLength in CalcLengthOrPercentage.
We replace Au with CSSPixelLength for the length part of computed::CalcLengthOrPercentage. Therefore, it would be easier to use CSSPixelLength for all other LengthOrPercentage{*} types.
This commit is contained in:
parent
a949e2a057
commit
535c1e3c6f
13 changed files with 99 additions and 117 deletions
|
@ -8,12 +8,12 @@ use style::values::computed::{CalcLengthOrPercentage, Percentage};
|
|||
|
||||
#[test]
|
||||
fn test_length_calc() {
|
||||
let calc = CalcLengthOrPercentage::new(Au(10), Some(Percentage(0.2)));
|
||||
let calc = CalcLengthOrPercentage::new(Au(10).into(), Some(Percentage(0.2)));
|
||||
assert_eq!(calc.to_used_value(Some(Au(10))), Some(Au(12)));
|
||||
assert_eq!(calc.to_used_value(Some(Au(0))), Some(Au(10)));
|
||||
assert_eq!(calc.to_used_value(None), None);
|
||||
|
||||
let calc = CalcLengthOrPercentage::new(Au(10), None);
|
||||
let calc = CalcLengthOrPercentage::new(Au(10).into(), None);
|
||||
assert_eq!(calc.to_used_value(Some(Au(0))), Some(Au(10)));
|
||||
assert_eq!(calc.to_used_value(None), Some(Au(10)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue