Auto merge of #26104 - tipowol:fix-23704, r=paulrouget

Update parse_length to match spec

<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23704
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2020-04-07 08:04:39 -04:00 committed by GitHub
commit 95da6dbd6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 171 deletions

View file

@ -66,7 +66,8 @@ pub fn test_parse_length() {
check("0", LengthOrPercentageOrAuto::Length(Au::from_px(0)));
check("0.000%", LengthOrPercentageOrAuto::Percentage(0.0));
check("+5.82%", LengthOrPercentageOrAuto::Percentage(0.0582));
check("+5.82%", LengthOrPercentageOrAuto::Auto);
check("5.82%", LengthOrPercentageOrAuto::Percentage(0.0582));
check(
"5.82",
LengthOrPercentageOrAuto::Length(Au::from_f64_px(5.82)),