Make util::str::parse_length work with floats

This commit is contained in:
Corey Farwell 2015-11-14 12:36:18 -05:00
parent 02a8e8dd16
commit 30ea772939
4 changed files with 4 additions and 1 deletions

View file

@ -367,7 +367,7 @@ pub fn parse_length(mut value: &str) -> LengthOrPercentageOrAuto {
}
match FromStr::from_str(value) {
Ok(number) => LengthOrPercentageOrAuto::Length(Au::from_px(number)),
Ok(number) => LengthOrPercentageOrAuto::Length(Au::from_f64_px(number)),
Err(_) => LengthOrPercentageOrAuto::Auto,
}
}