bors-servo
c8cd70f333
Auto merge of #16229 - tomhoule:fix-lengths, r=emilio
...
style: Do not immediately convert absolute specified lengths
<!-- Please describe your changes on the following line: -->
This PR aims to solve issue #15729 . I tried to follow the recommendations there as much as possible.
This is my first attempt at contributing to Servo, so this will probably need a lot of input, although I'm eager to make it as polished as possible.
- The base inaccuracy issue seems solved, as can be easily verified with the `console.log` based example in the issue.
- Very basic unit tests were added.
I have doubts mainly about the right way to represent these new enum variants for the various length units:
1. With new enum variants in `NoCalcLength` *and* newtypes (current solution)
2. With a `NoCalcLength::Absolute` variant that contains a new `AbsoluteLength` enum, but without newtypes
3. Same as solution 2 but with newtypes
- I mostly cared about unit tests until now but will investigate other types of tests
- Tests to check the clamping
- Write a proper commit message
Thanks for your time and feedback :)
---
<!-- 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 #15729 .
<!-- Either: -->
- [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. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg " height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16229 )
<!-- Reviewable:end -->
2017-04-12 01:16:32 -05:00
..
2017-04-09 17:34:16 -07:00
2017-03-17 11:40:03 +01:00
2016-10-23 17:46:10 -07:00
2017-04-05 01:52:38 -04:00
2016-12-22 16:06:22 +01:00
2016-12-08 08:50:35 -10:00
2016-10-11 19:44:32 +02:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-04-09 17:34:16 -07:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-13 17:38:33 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-04-04 16:46:52 -04:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-27 19:54:13 +02:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2016-10-06 21:35:49 +02:00
2016-12-16 16:57:20 +01:00
2017-02-24 01:50:51 +01:00
2017-03-14 00:49:18 +01:00
2017-03-19 22:30:35 +01:00
2017-03-30 11:41:07 +11:00
2017-03-19 22:30:35 +01:00
2017-03-19 22:30:36 +01:00
2017-03-19 22:30:38 +01:00
2017-04-03 21:57:16 +10:00
2017-03-19 22:30:36 +01:00
2017-03-19 22:30:36 +01:00
2017-04-09 17:49:14 +08:00
2017-04-03 21:18:09 +10:00
2017-04-03 21:57:16 +10:00
2017-03-19 22:30:37 +01:00
2017-03-19 22:30:35 +01:00
2017-03-19 22:30:36 +01:00
2017-03-19 22:30:36 +01:00
2017-03-07 17:37:44 +08:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-17 10:53:20 -05:00
2017-04-09 18:15:53 +08:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-04-12 11:51:57 +08:00
2017-03-07 17:37:44 +08:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-26 14:15:31 +02:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-04-09 23:30:40 -07:00
2017-03-30 14:27:40 +02:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-15 10:34:23 -05:00
2017-03-30 11:45:48 +08:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-15 16:39:55 +01:00
2017-04-09 18:15:53 +08:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-15 16:39:55 +01:00
2017-03-20 00:06:04 -07:00
2017-02-24 01:50:51 +01:00
2017-03-26 16:15:06 +02:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-15 10:34:23 -05:00
2017-04-04 23:11:44 +08:00
2017-03-15 16:39:55 +01:00
2017-03-15 16:39:55 +01:00
2017-03-15 16:39:55 +01:00
2017-02-24 01:50:51 +01:00
2017-03-19 22:30:39 +01:00
2017-04-04 23:11:44 +08:00
2017-02-24 01:50:51 +01:00
2017-04-03 21:57:16 +10:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-15 16:39:55 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-15 16:39:55 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-15 16:39:55 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-04-03 21:57:16 +10:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-15 16:39:55 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-20 21:16:55 +01:00
2017-02-24 01:50:51 +01:00
2017-03-15 10:34:23 -05:00
2017-02-03 14:57:08 -05:00
2017-02-24 01:50:51 +01:00
2017-03-19 22:30:34 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-04-05 01:52:38 -04:00
2017-02-24 01:50:51 +01:00
2017-04-05 01:52:38 -04:00
2017-04-05 01:52:38 -04:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2016-12-14 18:04:37 -06:00
2017-03-15 16:39:55 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-21 15:55:45 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-07 17:37:44 +08:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-04-04 16:46:52 -04:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-07 13:31:22 +01:00
2017-04-07 12:52:50 +02:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-13 17:38:33 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-13 17:38:33 +01:00
2017-02-24 01:50:51 +01:00
2017-03-07 13:31:22 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-26 16:15:06 +02:00
2017-03-26 16:15:06 +02:00
2017-02-24 01:50:51 +01:00
2017-03-13 21:57:50 +08:00
2016-11-23 22:46:57 -08:00
2017-02-24 01:50:51 +01:00
2017-03-15 16:39:55 +01:00
2017-02-24 01:50:51 +01:00
2017-03-22 17:41:15 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-27 19:54:13 +02:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-24 11:09:30 +01:00
2017-03-30 14:27:40 +02:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00
2017-03-07 17:37:44 +08:00
2017-02-24 01:50:51 +01:00
2017-02-24 01:50:51 +01:00