It's wasteful for NodeListsNodeData to have HashMap, HashSet, of all node list types. This will become a serious problem when we try to make HTMLCollection behave more like DynamicNodeList.
Created attachment 147405 [details] work in progress
Another thing I want to do this in patch is to move more code from Node/NodeListsNodeData to subclasses of DynamicNodeList so that we don't have modify so much code to add a new type of DynamicNodeList.
Created attachment 148646 [details] work in progress 2 Here, I've replaced HashMaps by a Vector of DynamicNodeListCache objects. But I think this incurs too much overhead and is somewhat over-engineered. I'll take some goodies that came out of this patch and fix in separate bugs.
Created attachment 148721 [details] Patch
Comment on attachment 148721 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148721&action=review > Source/WebCore/dom/NodeRareData.h:57 > + template<typename T> > + PassRefPtr<T> addCacheWithAtomicName(Node* node, DynamicNodeList::NodeListType listType, const AtomicString& name) Should we use some sort of traits to avoid manually passing list type here?
Comment on attachment 148721 [details] Patch r=me
Committed r120979: <http://trac.webkit.org/changeset/120979>