mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
Make computed types hold Percentage instead of bare CSSFloat
This commit is contained in:
parent
4b633c8637
commit
608e7f71a2
22 changed files with 140 additions and 110 deletions
|
@ -5,10 +5,11 @@
|
|||
use app_units::Au;
|
||||
use style::attr::{AttrValue, LengthOrPercentageOrAuto, parse_length};
|
||||
use style::values::computed::CalcLengthOrPercentage;
|
||||
use style::values::specified::length::Percentage;
|
||||
|
||||
#[test]
|
||||
fn test_length_calc() {
|
||||
let calc = CalcLengthOrPercentage::new(Au(10), Some(0.2));
|
||||
let calc = CalcLengthOrPercentage::new(Au(10), 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue