servo/components/script/dom
Anthony Ramine 58e1bd0e57 Introduce VirtualMethods::attribute_mutated()
This replaces before_remove_attr(), after_remove_attr() and after_set_attr().
The virtual method takes the mutated attribute and an AttributeMutation value
to disambiguate between "attribute is changed", "attribute is added" and
"attribute is removed".

In the case of "attribute is changed", the mutation value contains a reference
to the old value of the mutated attribute, which is used to unregister outdated
named elements when the "id" attribute is changed on an element.

This greatly simplifies the handling of attributes, which in many cases don't
have any specific behaviour whether they are removed or changed or added. It
also fixes a few bugs where things were put in before_remove_attr() instead of
after_remove_attr() (e.g. when removing an href attribute from a base element).

A few helper functions in Element were also renamed and made private.
2015-09-02 15:45:38 +02:00
..
bindings Prefer JSTrue/JSFalse to 1/0 2015-08-28 22:03:01 -04:00
webidls Implement 'do nothing' methods on Window and Document 2015-08-27 13:13:10 -04:00
activation.rs Remove helper traits 2015-08-27 16:59:02 +02:00
attr.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
blob.rs Replace many uses of to_ascii_lowercase() by make_ascii_lowercase() 2015-08-30 15:30:00 +02:00
browsercontext.rs Remove helper traits 2015-08-27 16:59:02 +02:00
canvasgradient.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
canvaspattern.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
canvasrenderingcontext2d.rs Merge adjacent identical impl sections 2015-08-28 10:30:42 -04:00
characterdata.rs Fix CharacterDataMethods to count UTF-16 code units, not code points. 2015-08-28 11:58:38 +02:00
closeevent.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
comment.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
console.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
create.rs sort all uses 2015-08-20 20:47:12 +08:00
crypto.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
css.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
cssstyledeclaration.rs Replace many uses of to_ascii_lowercase() by make_ascii_lowercase() 2015-08-30 15:30:00 +02:00
customevent.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
dedicatedworkerglobalscope.rs Merge adjacent identical impl sections 2015-08-28 10:30:42 -04:00
document.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
documentfragment.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
documenttype.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
domexception.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
domimplementation.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
domparser.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
dompoint.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
dompointreadonly.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
domrect.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
domrectlist.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
domstringmap.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
domtokenlist.rs Merge adjacent identical impl sections 2015-08-28 10:30:42 -04:00
element.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
errorevent.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
event.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
eventdispatcher.rs Remove helper traits 2015-08-27 16:59:02 +02:00
eventtarget.rs Merge adjacent identical impl sections 2015-08-28 10:30:42 -04:00
file.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
filelist.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
filereader.rs Time distribution across script event categories. 2015-08-28 00:52:41 +02:00
formdata.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
htmlanchorelement.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
htmlappletelement.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
htmlareaelement.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
htmlaudioelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlbaseelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmlbodyelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmlbrelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlbuttonelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmlcanvaselement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmlcollection.rs Replace many uses of to_ascii_lowercase() by make_ascii_lowercase() 2015-08-30 15:30:00 +02:00
htmldataelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmldatalistelement.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
htmldialogelement.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
htmldirectoryelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmldivelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmldlistelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmlembedelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlfieldsetelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmlfontelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmlformelement.rs Replace many uses of Attr::Value() by Attr::value() 2015-08-30 15:30:01 +02:00
htmlframeelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlframesetelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlheadelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlheadingelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlhrelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlhtmlelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmliframeelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmlimageelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmlinputelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmllabelelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmllegendelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmllielement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmllinkelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmlmapelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlmediaelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlmetaelement.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
htmlmeterelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlmodelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlobjectelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmlolistelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmloptgroupelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmloptionelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmloutputelement.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
htmlparagraphelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlparamelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlpreelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlprogresselement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlquoteelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlscriptelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmlselectelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmlsourceelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlspanelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlstyleelement.rs Merge adjacent identical impl sections 2015-08-28 10:30:42 -04:00
htmltablecaptionelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmltablecellelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmltablecolelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmltabledatacellelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmltableelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmltableheadercellelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmltablerowelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmltablesectionelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmltemplateelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmltextareaelement.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
htmltimeelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmltitleelement.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
htmltrackelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlulistelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlunknownelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
htmlvideoelement.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
imagedata.rs Merge adjacent identical impl sections 2015-08-28 10:30:42 -04:00
keyboardevent.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
location.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
macros.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
messageevent.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
mod.rs Remove reference to helper traits from documentation 2015-08-27 16:59:04 +02:00
mouseevent.rs Replace catch-all experimental flag with fine-grained boolean preferences initialized from a JSON document. 2015-08-28 10:30:04 -04:00
namednodemap.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
navigator.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
navigatorinfo.rs sort all uses 2015-08-20 20:47:12 +08:00
node.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
nodeiterator.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
nodelist.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
performance.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
performancetiming.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
processinginstruction.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
progressevent.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
range.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
screen.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
servohtmlparser.rs Remove SinkHelpers 2015-08-27 16:59:03 +02:00
storage.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
storageevent.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
testbinding.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
testbindingproxy.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
text.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
textdecoder.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
textencoder.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
treewalker.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
uievent.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
url.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
urlhelper.rs Cleanup NodeIterator, Range, ServoHTMLParser, TextEncoder, URLHelper, URL, VirtualMethods 2015-08-18 19:37:42 +05:30
urlsearchparams.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
userscripts.rs Remove AttributeHandlers 2015-08-27 16:59:04 +02:00
validitystate.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
virtualmethods.rs Introduce VirtualMethods::attribute_mutated() 2015-09-02 15:45:38 +02:00
webglactiveinfo.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
webglbuffer.rs Remove helper traits 2015-08-27 16:59:02 +02:00
webglframebuffer.rs Remove helper traits 2015-08-27 16:59:02 +02:00
webglobject.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00
webglprogram.rs Remove helper traits 2015-08-27 16:59:02 +02:00
webglrenderbuffer.rs Remove helper traits 2015-08-27 16:59:02 +02:00
webglrenderingcontext.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
webglshader.rs Remove helper traits 2015-08-27 16:59:02 +02:00
webglshaderprecisionformat.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
webgltexture.rs Remove helper traits 2015-08-27 16:59:02 +02:00
webgluniformlocation.rs Remove helper traits 2015-08-27 16:59:02 +02:00
websocket.rs Time distribution across script event categories. 2015-08-28 00:52:41 +02:00
window.rs Replace many uses of to_ascii_lowercase() by make_ascii_lowercase() 2015-08-30 15:30:00 +02:00
worker.rs Time distribution across script event categories. 2015-08-28 00:52:41 +02:00
workerglobalscope.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
workerlocation.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
workernavigator.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
xmlhttprequest.rs Time distribution across script event categories. 2015-08-28 00:52:41 +02:00
xmlhttprequesteventtarget.rs Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
xmlhttprequestupload.rs make dom_struct derive HeapSizeOf, 2015-08-27 01:17:48 +01:00