servo/components/layout
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
..
css Wrap SharedLayoutContext::new_animations_sender in a Mutex. 2015-11-07 11:23:47 +01:00
animation.rs Wrap SharedLayoutContext::new_animations_sender in a Mutex. 2015-11-07 11:23:47 +01:00
block.rs Eliminate LAYERS_NEEDED_FOR_DESCENDANTS flag 2015-11-04 15:29:47 -08:00
Cargo.toml Update to rust-cssparser 0.4.0 2015-11-05 08:57:01 +01:00
construct.rs replace InheritTypes imports with inheritance imports 2015-10-30 20:26:30 +09:00
context.rs Remove the unsafe Sync implementation for SharedLayoutContext. 2015-11-07 11:23:50 +01:00
data.rs layout: Make the compositor rather than layout determine the position of 2015-09-29 09:47:28 -07:00
display_list_builder.rs Wrap SharedLayoutContext::canvas_layers_sender in a Mutex. 2015-11-07 11:23:48 +01:00
flex.rs Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
floats.rs Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
flow.rs Remove unused Flow::remove_compositor_layers. 2015-11-07 11:23:43 +01:00
flow_list.rs Remove explicit lifetimes which can be elided. 2015-10-21 01:27:48 +02:00
flow_ref.rs Remove explicit lifetimes which can be elided. 2015-10-21 01:27:48 +02:00
fragment.rs Pass all the data layout needs from canvas elements at once. 2015-10-26 11:43:23 +01:00
generated_content.rs Fix issues found by rust-clippy 2015-10-12 20:21:49 -04:00
incremental.rs Fix reported test-tidy errors for unmerged import blocks 2015-09-19 12:50:14 -04:00
inline.rs Change overflow calculation to be calculated after compute_absolute_position. 2015-11-03 20:10:06 +10:00
layout_debug.rs sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
layout_task.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
list_item.rs Show overflow for #8118. 2015-10-27 15:07:59 -07:00
model.rs Implement calc expressions for more value types 2015-11-01 23:16:14 -08:00
multicol.rs Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
opaque_node.rs Replace OpaqueNodeMethods::from_{threadsafe_,}layout_node by opaque methods. 2015-06-24 14:55:43 +02:00
parallel.rs Change overflow calculation to be calculated after compute_absolute_position. 2015-11-03 20:10:06 +10:00
query.rs Allow retrieving width/height for non-positioned elements 2015-11-03 20:13:09 -08:00
sequential.rs Change overflow calculation to be calculated after compute_absolute_position. 2015-11-03 20:10:06 +10:00
table.rs Auto merge of #8327 - Ms2ger:unused-arg, r=frewsxcv 2015-11-05 18:56:26 +05:30
table_caption.rs Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
table_cell.rs Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
table_colgroup.rs Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
table_row.rs Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
table_rowgroup.rs Remove unused argument from TableLikeFlow::assign_block_size_for_table_like_flow. 2015-11-04 09:57:01 +01:00
table_wrapper.rs Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
text.rs display input caret for textarea. fixes #7758 2015-10-21 22:38:23 +02:00
traversal.rs Wrap SharedLayoutContext::stylist in a wrapper to make it Sync. 2015-11-07 11:23:49 +01:00
wrapper.rs Store pristine element state rather than a set of changes. 2015-11-04 19:09:58 -08:00