mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Make util::str::parse_length work with floats
This commit is contained in:
parent
02a8e8dd16
commit
30ea772939
4 changed files with 4 additions and 1 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue