servo/components/script
Till Schneidereit 543703e3d8 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.
2015-11-07 18:11:29 +01:00
..
docs Move the DOM memory management blog post into the tree. 2015-10-29 17:25:00 +01:00
dom Move Stylesheet loading and ownership from the layout task into HTML elements 2015-11-07 18:11:29 +01:00
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 M1503 - Integrate XML parse -Initial Steps 2015-11-04 19:18:20 -05: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 Move Stylesheet loading and ownership from the layout task into HTML elements 2015-11-07 18:11:29 +01:00
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 Move Stylesheet loading and ownership from the layout task into HTML elements 2015-11-07 18:11:29 +01:00
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