servo/components/style
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
..
animation.rs Implement calc expressions for more value types 2015-11-01 23:16:14 -08:00
build.rs sort all uses 2015-08-20 20:47:12 +08:00
Cargo.toml Update to rust-cssparser 0.4.0 2015-11-05 08:57:01 +01:00
custom_properties.rs Fix double /**//**/ 2015-11-06 23:01:55 +01:00
font_face.rs Auto merge of #8039 - tschneidereit:script-owns-stylesheets, r=jdm 2015-11-08 01:11:54 +05:30
legacy.rs Fix reported test-tidy errors for unmerged import blocks 2015-09-19 12:50:14 -04:00
lib.rs Implement restyle hints for state changes. 2015-10-31 14:28:52 -07:00
Mako-0.9.1.zip Cargoify servo 2014-09-08 20:21:42 -06:00
media_queries.rs Derive HeapSizeOf on more Stylesheet-related types 2015-11-07 16:19:23 +01:00
node.rs Fix reported test-tidy errors for unmerged import blocks 2015-09-19 12:50:14 -04:00
parser.rs Fix reported test-tidy errors for unmerged import blocks 2015-09-19 12:50:14 -04:00
properties.mako.rs Detect var() in shorthand declarations. 2015-11-06 23:01:54 +01:00
README.md Update style/README.md - libcss is gone now 2014-10-23 16:23:54 -05:00
restyle_hints.rs Store pristine element state rather than a set of changes. 2015-11-04 19:09:58 -08:00
selector_matching.rs Auto merge of #8039 - tschneidereit:script-owns-stylesheets, r=jdm 2015-11-08 01:11:54 +05:30
stylesheets.rs Move Stylesheet loading and ownership from the layout task into HTML elements 2015-11-07 18:11:29 +01:00
values.rs Update to rust-cssparser 0.4.0 2015-11-05 08:57:01 +01:00
viewport.rs Derive HeapSizeOf on more Stylesheet-related types 2015-11-07 16:19:23 +01:00

servo-style

Style system for Servo, using rust-cssparser for parsing.