-
Notifications
You must be signed in to change notification settings - Fork 1
Element ID
keishi edited this page Jul 6, 2012
·
6 revisions
ID mapping is managed inside the TreeScope.
ID lookup is performed through nsDocument::mIdentifierMap.
/* mIdentifierMap works as follows for IDs:
* 1) Attribute changes affect the table immediately (removing and adding
* entries as needed).
* 2) Removals from the DOM affect the table immediately
* 3) Additions to the DOM always update existing entries for names, and add
* new ones for IDs.
*/
nsTHashtable<nsIdentifierMapEntry> mIdentifierMap;nsIdentifierMapEntry::mIdContentList contains the list of elements with the same id. They are already sorted, so all GetIdElement() needs to do is return nsIdentifierMapEntry::mIdContentList[0].