servo/components/script
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
..
docs Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
dom Auto merge of #16229 - tomhoule:fix-lengths, r=emilio 2017-04-12 01:16:32 -05:00
task_source
body.rs Rename Reflectable to DomObject. 2016-12-08 08:50:35 -10:00
build.rs Fix hardcoded path to link.exe 2017-02-03 13:33:37 +01:00
Cargo.toml Update string-cache. 2017-04-07 13:38:40 +02:00
clipboard_provider.rs
CMakeLists.txt
devtools.rs Added some same-origin-domain checks. 2017-03-14 14:36:03 -05:00
document_loader.rs Remove mutability requirement from fetch_async_background. 2017-02-28 10:23:23 -05:00
fetch.rs Remove all internal mutability from Request 2017-04-03 12:39:07 +02:00
layout_image.rs Make image cache per-document rather than global 2017-03-27 19:54:13 +02:00
layout_wrapper.rs stylo: Store font metrics provider in thread local style context 2017-04-09 19:15:35 +08:00
lib.rs Revert to per-process shared lock for author-origin stylesheets 2017-04-03 18:08:20 +02:00
mem.rs Rename Reflectable to DomObject. 2016-12-08 08:50:35 -10:00
microtask.rs Generalize promise job queue into solitary microtask queue. 2017-02-01 12:54:33 -05:00
network_listener.rs Separate the async bluetooth handling from networking code. 2016-12-21 14:52:39 +01:00
script_runtime.rs Update rust-mozjs to master. 2017-03-31 14:40:38 -04:00
script_thread.rs Implement basic interface for MutationObserver and MutationRecord. 2017-04-05 01:52:38 -04:00
serviceworker_manager.rs Removed util. 2016-12-14 18:04:37 -06:00
serviceworkerjob.rs Remove incorrect uses of asynchronous tasks from ServiceWorker job queue. 2017-02-01 12:54:33 -05:00
stylesheet_loader.rs Use final url for updating stylesheet from @import rule. 2017-04-03 21:57:17 +10:00
test.rs Added compiletest to verify TrustedPromise does not implement Clone 2017-01-22 20:12:07 +00:00
textinput.rs
timers.rs Terminate timer scheduler thread during shutdown 2017-03-30 14:27:40 +02:00
unpremultiplytable.rs
webdriver_handlers.rs Update Hyper and OpenSSL 2017-03-31 16:32:21 +02:00