servo/components/script
bors-servo 7ff3a17524 Auto merge of #8039 - tschneidereit:script-owns-stylesheets, r=jdm
Move Stylesheet loading and ownership from the layout task into HTML elements

Stylesheets for `HTMLLinkElement`s are now loaded by the resource task, triggered by the element in question. Stylesheets are owned by the elements they're associated with, which can be `HTMLStyleElement`, `HTMLLinkElement`, and `HTMLMetaElement` (for `<meta name="viewport">).

Additionally, the quirks mode stylesheet (just as the user and user agent stylesheets a couple of commits ago), is implemented as a lazy static, loaded once per process and shared between all documents.

This all has various nice consequences:
 - Stylesheet loading becomes a non-blocking operation.
 - Stylesheets are removed when the element they're associated with is removed from the document.
 - It'll be possible to implement the CSSOM APIs that require direct access to the stylesheets (i.e., ~ all of them).
 - Various subtle correctness issues are fixed.

One piece of interesting follow-up work would be to move parsing of external stylesheets to the resource task, too. Right now, it happens in the link element once loading is complete, so blocks the script task. Moving it to the resource task would probably be fairly straight-forward as it doesn't require access to any external state.

Depends on #7979 because without that loading stylesheets asynchronously breaks lots of content.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8039)
<!-- Reviewable:end -->
2015-11-08 01:11:54 +05:30
..
docs Move the DOM memory management blog post into the tree. 2015-10-29 17:25:00 +01:00
dom Auto merge of #8039 - tschneidereit:script-owns-stylesheets, r=jdm 2015-11-08 01:11:54 +05:30
parse Silence unused code warnings. 2015-11-05 09:58:56 +01:00
build.rs Fix build scripts warnings. 2015-03-18 21:53:48 +01:00
Cargo.toml Update to rust-cssparser 0.4.0 2015-11-05 08:57:01 +01:00
clipboard_provider.rs Fix reported test-tidy errors for unmerged import blocks 2015-09-19 12:50:14 -04:00
cors.rs Simplify AsyncResponseListener implementations. 2015-10-15 16:53:47 -07:00
devtools.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
document_loader.rs Check in for task 1,4 and 5 2015-11-05 00:17:24 -05:00
layout_interface.rs Auto merge of #8039 - tschneidereit:script-owns-stylesheets, r=jdm 2015-11-08 01:11:54 +05:30
lib.rs Move EventState to rust-selectors. 2015-10-30 21:02:35 -07:00
makefile.cargo Fix spurious rebuilds of the script crate 2015-10-08 21:37:56 -07:00
mem.rs more refactoring 2015-10-30 20:26:29 +09:00
network_listener.rs Make AsyncResponseListener methods take &mut self. 2015-10-15 16:44:39 -07:00
page.rs Removed JS::root Fixes #8251 2015-10-31 18:15:16 +05:30
script_task.rs Auto merge of #8039 - tschneidereit:script-owns-stylesheets, r=jdm 2015-11-08 01:11:54 +05:30
textinput.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
timers.rs merge from master 2015-11-03 19:01:23 +09:00
unpremultiplytable.rs add un-premultiply table for GetImageData 2015-10-20 04:51:29 -04:00
webdriver_handlers.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00