servo/components/script/dom
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
..
bindings Implement cancellable runnables. 2015-11-06 10:41:38 -05:00
webidls Implement the overrideMimeType method for XMLHttpRequest 2015-11-05 22:19:24 -05:00
activation.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
attr.rs Remove HTMLTableCellElement fields with parsed attribute values. 2015-11-04 17:09:26 -08:00
blob.rs Auto merge of #8218 - nikkisquared:master, r=eefriedman 2015-11-05 10:24:27 +05:30
browsercontext.rs Make BrowsingContext JS-managed. 2015-11-04 12:30:13 +01:00
canvasgradient.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
canvaspattern.rs more refactoring 2015-10-30 20:26:29 +09:00
canvasrenderingcontext2d.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
characterdata.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
closeevent.rs more refactoring 2015-10-30 20:26:29 +09:00
comment.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
console.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
create.rs Move Stylesheet loading and ownership from the layout task into HTML elements 2015-11-07 18:11:29 +01:00
crypto.rs more refactoring 2015-10-30 20:26:29 +09:00
css.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
cssstyledeclaration.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
customevent.rs Get rid of a bunch of explicit derefs 2015-11-03 19:51:46 -08:00
dedicatedworkerglobalscope.rs Check in for task 1,4 and 5 2015-11-05 00:17:24 -05:00
document.rs Move Stylesheet loading and ownership from the layout task into HTML elements 2015-11-07 18:11:29 +01:00
documentfragment.rs move Castable into dom::bindings::inheritance 2015-10-30 20:24:42 +09:00
documenttype.rs Use DOMString::new() somewhat consistently. 2015-11-04 12:09:10 +01:00
domexception.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
domimplementation.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
domparser.rs M1503 - Integrate XML parse -Initial Steps 2015-11-04 19:18:20 -05:00
dompoint.rs more refactoring 2015-10-30 20:26:29 +09:00
dompointreadonly.rs more refactoring 2015-10-30 20:26:29 +09:00
domrect.rs more refactoring 2015-10-30 20:26:29 +09:00
domrectlist.rs merge from master 2015-11-03 19:01:23 +09:00
domrectreadonly.rs more refactoring 2015-10-30 20:26:29 +09:00
domstringmap.rs Use DOMString::new() somewhat consistently. 2015-11-04 12:09:10 +01:00
domtokenlist.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
element.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
errorevent.rs Use DOMString::new() somewhat consistently. 2015-11-04 12:09:10 +01:00
event.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
eventdispatcher.rs merge from master 2015-11-03 19:01:23 +09:00
eventtarget.rs merge from master 2015-11-03 19:01:23 +09:00
file.rs more refactoring 2015-10-30 20:26:29 +09:00
filelist.rs merge from master 2015-11-03 19:01:23 +09:00
filereader.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
formdata.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmlanchorelement.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmlappletelement.rs move Castable into dom::bindings::inheritance 2015-10-30 20:24:42 +09:00
htmlareaelement.rs more refactoring 2015-10-30 20:26:29 +09:00
htmlaudioelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlbaseelement.rs move Castable into dom::bindings::inheritance 2015-10-30 20:24:42 +09:00
htmlbodyelement.rs Remove HTMLTableCellElement fields with parsed attribute values. 2015-11-04 17:09:26 -08:00
htmlbrelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlbuttonelement.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmlcanvaselement.rs Auto merge of #8243 - eefriedman:canvas-width-height, r=Ms2ger 2015-11-04 23:22:09 +05:30
htmlcollection.rs Get rid of a bunch of explicit derefs 2015-11-03 19:51:46 -08:00
htmldataelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmldatalistelement.rs move Castable into dom::bindings::inheritance 2015-10-30 20:24:42 +09:00
htmldialogelement.rs Use DOMString::new() somewhat consistently. 2015-11-04 12:09:10 +01:00
htmldirectoryelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmldivelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmldlistelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlelement.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmlembedelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlfieldsetelement.rs Get rid of a bunch of explicit derefs 2015-11-03 19:51:46 -08:00
htmlfontelement.rs merge from master 2015-11-03 19:01:23 +09:00
htmlformelement.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmlframeelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlframesetelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlheadelement.rs move Castable into dom::bindings::inheritance 2015-10-30 20:24:42 +09:00
htmlheadingelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlhrelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlhtmlelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmliframeelement.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmlimageelement.rs Implement cancellable runnables. 2015-11-06 10:41:38 -05:00
htmlinputelement.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmllabelelement.rs merge from master 2015-11-03 19:01:23 +09:00
htmllegendelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmllielement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmllinkelement.rs Move Stylesheet loading and ownership from the layout task into HTML elements 2015-11-07 18:11:29 +01:00
htmlmapelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlmediaelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlmetaelement.rs Move Stylesheet loading and ownership from the layout task into HTML elements 2015-11-07 18:11:29 +01:00
htmlmeterelement.rs make test-tidy happy + fix some merge errors 2015-11-03 19:11:01 +09:00
htmlmodelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlobjectelement.rs move Castable into dom::bindings::inheritance 2015-10-30 20:24:42 +09:00
htmlolistelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmloptgroupelement.rs merge from master 2015-11-03 19:01:23 +09:00
htmloptionelement.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmloutputelement.rs make test-tidy happy + fix some merge errors 2015-11-03 19:11:01 +09:00
htmlparagraphelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlparamelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlpreelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlprogresselement.rs make test-tidy happy + fix some merge errors 2015-11-03 19:11:01 +09:00
htmlquoteelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlscriptelement.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmlselectelement.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmlsourceelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlspanelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlstyleelement.rs Move Stylesheet loading and ownership from the layout task into HTML elements 2015-11-07 18:11:29 +01:00
htmltablecaptionelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmltablecellelement.rs Remove HTMLTableCellElement fields with parsed attribute values. 2015-11-04 17:09:26 -08:00
htmltablecolelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmltabledatacellelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmltableelement.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmltableheadercellelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmltablerowelement.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmltablesectionelement.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmltemplateelement.rs move Castable into dom::bindings::inheritance 2015-10-30 20:24:42 +09:00
htmltextareaelement.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmltimeelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmltitleelement.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
htmltrackelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlulistelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlunknownelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
htmlvideoelement.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
imagedata.rs more refactoring 2015-10-30 20:26:29 +09:00
keyboardevent.rs Cleanup some unneeded let bindings 2015-11-06 00:22:31 -08:00
location.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
macros.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
messageevent.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
mod.rs M1503 - Integrate XML parse -Initial Steps 2015-11-04 19:18:20 -05:00
mouseevent.rs Get rid of a bunch of explicit derefs 2015-11-03 19:51:46 -08:00
namednodemap.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
navigator.rs more refactoring 2015-10-30 20:26:29 +09:00
navigatorinfo.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
node.rs Cleanup some unneeded let bindings 2015-11-06 00:22:31 -08:00
nodeiterator.rs Get rid of a bunch of explicit derefs 2015-11-03 19:51:46 -08:00
nodelist.rs merge from master 2015-11-03 19:01:23 +09:00
performance.rs merge from master 2015-11-03 19:01:23 +09:00
performancetiming.rs more refactoring 2015-10-30 20:26:29 +09:00
processinginstruction.rs Explicitly customise flags of new nodes where needed 2015-10-15 17:30:41 +02:00
progressevent.rs rearrange imports to be in alphabetical order 2015-10-30 20:28:59 +09:00
range.rs Use DOMString::new() somewhat consistently. 2015-11-04 12:09:10 +01:00
screen.rs more refactoring 2015-10-30 20:26:29 +09:00
servohtmlparser.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
servoxmlparser.rs M1503 - Integrate XML parse -Initial Steps 2015-11-04 19:18:20 -05:00
storage.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
storageevent.rs rearrange imports to be in alphabetical order 2015-10-30 20:28:59 +09:00
testbinding.rs Use DOMString::new() somewhat consistently. 2015-11-04 12:09:10 +01:00
testbindingproxy.rs Use DOMString::new() somewhat consistently. 2015-11-04 12:09:10 +01:00
text.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
textdecoder.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
textencoder.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
touch.rs more refactoring 2015-10-30 20:26:29 +09:00
touchevent.rs rearrange imports to be in alphabetical order 2015-10-30 20:28:59 +09:00
touchlist.rs merge from master 2015-11-03 19:01:23 +09:00
treewalker.rs Get rid of a bunch of explicit derefs 2015-11-03 19:51:46 -08:00
uievent.rs Get rid of a bunch of explicit derefs 2015-11-03 19:51:46 -08:00
url.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
urlhelper.rs Update URL-related interfaces and their tests up to spec 2015-10-19 21:05:07 +02:00
urlsearchparams.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
userscripts.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
validitystate.rs more refactoring 2015-10-30 20:26:29 +09:00
values.rs Consolidate magic number representing max unsigned long 2015-10-10 13:46:11 -04:00
virtualmethods.rs rearrange imports to be in alphabetical order 2015-10-30 20:28:59 +09:00
webglactiveinfo.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
webglbuffer.rs merge from master 2015-11-03 19:01:23 +09:00
webglcontextevent.rs Use DOMString::new() somewhat consistently. 2015-11-04 12:09:10 +01:00
webglframebuffer.rs merge from master 2015-11-03 19:01:23 +09:00
webglobject.rs more refactoring 2015-10-30 20:26:29 +09:00
webglprogram.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
webglrenderbuffer.rs merge from master 2015-11-03 19:01:23 +09:00
webglrenderingcontext.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
webglshader.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
webglshaderprecisionformat.rs more refactoring 2015-10-30 20:26:29 +09:00
webgltexture.rs merge from master 2015-11-03 19:01:23 +09:00
webgluniformlocation.rs more refactoring 2015-10-30 20:26:29 +09:00
websocket.rs Cleanup WebSocket::Send_Impl. 2015-11-05 12:23:18 +01:00
window.rs Move Stylesheet loading and ownership from the layout task into HTML elements 2015-11-07 18:11:29 +01:00
worker.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
workerglobalscope.rs Check in for task 1,4 and 5 2015-11-05 00:17:24 -05:00
workerlocation.rs Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +01:00
workernavigator.rs more refactoring 2015-10-30 20:26:29 +09:00
xmlhttprequest.rs Implement the overrideMimeType method for XMLHttpRequest 2015-11-05 22:19:24 -05:00
xmlhttprequesteventtarget.rs Introduce trait Castable 2015-10-21 11:37:16 +02:00
xmlhttprequestupload.rs more refactoring 2015-10-30 20:26:29 +09:00