servo/components/script/dom
Alan Jeffrey 237ddc3c0c Caching HTMCollections.
We cache the state of any live HTMLCollection, keeping track of

a) the optional cached length of the collection, and
b) an optional cursor into the collection (a node in the collection plus its index).

The cache is invalidated based on the version number of the node.

We use these caches for speeding up random access to the collection.
When returning coll[i], we search from the cursor, if it exists,
and otherwise search from the front of the collection.
In particular, both a forward for-loop and a backward for-loop
through the collection will now have each access take O(1)
time rather than O(n) time.

This gets 1000x speed-up on the relevant Dromaeo DOM query tests.
2015-11-06 17:23:17 -06:00
..
bindings Made QualName traceable by JS. 2015-11-06 17:23:15 -06: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 Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +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 Caching HTMCollections. 2015-11-06 17:23:17 -06: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 Caching HTMCollections. 2015-11-06 17:23:17 -06: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 Make DOMString a newtype around String, rather than a typedef. 2015-11-04 12:09:11 +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 Get rid of a bunch of explicit derefs 2015-11-03 19:51:46 -08: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 Get rid of a bunch of explicit derefs 2015-11-03 19:51:46 -08: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 Added versioning to DOM nodes. 2015-11-06 17:23:16 -06: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 Auto merge of #8304 - dzbarsky:borrowck, r=Ms2ger 2015-11-07 01:31:40 +05:30
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