servo/tests/unit
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
..
gfx Make the parser accept @font-face rules without font-family or src. 2017-04-01 14:05:32 +02:00
layout #13262 Add a unit test verifying that SpecificFragmentInfo size 2016-09-25 10:35:39 +02:00
net Move the HTTP connector in HttpState 2017-04-06 19:35:11 +02:00
net_traits Moved pub_domains to net_traits and did a spring clean. 2016-09-29 17:28:47 -05:00
profile Update serde to 0.9 (fixes #15325) 2017-02-18 21:09:46 +01:00
script script: Update expected size of elements now we have bigger state flags. 2017-03-29 15:44:47 +02:00
servo_config Allow cli prefs to have numerical value 2017-01-05 19:32:14 +01:00
servo_remutex Removed util. 2016-12-14 18:04:37 -06:00
style Auto merge of #16229 - tomhoule:fix-lengths, r=emilio 2017-04-12 01:16:32 -05:00
stylo Update cssparser in Cargo.toml. 2017-04-07 16:07:37 +10:00