HTMLCollection on Document should use NodeRareData like other HTMLCollection and LiveNodeList
Created attachment 176196 [details] Cleanup
Comment on attachment 176196 [details] Cleanup Oh, oops. This changelog contains the old bug title :(
Committed r135893: <http://trac.webkit.org/changeset/135893>
Comment on attachment 176196 [details] Cleanup View in context: https://bugs.webkit.org/attachment.cgi?id=176196&action=review > Source/WebCore/dom/NodeRareData.h:79 > + PassRefPtr<T> addCacheWithAtomicName(Node* node, CollectionType collectionType) Could this have been ContainerNode* across the board instead of Node*?
(In reply to comment #4) > (From update of attachment 176196 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=176196&action=review > > > Source/WebCore/dom/NodeRareData.h:79 > > + PassRefPtr<T> addCacheWithAtomicName(Node* node, CollectionType collectionType) > > Could this have been ContainerNode* across the board instead of Node*? No. Some addCacheWithAtomicName callers are member functions of Node. It is true that all owner nodes are ContainerNode since they’re either Document, Element, or ShadowRoot but we probably need to move all those member functions from Node to ContainerNode in order to change the type. Otherwise, we’ll be doing a lot of const_casts, which isn’t particularly better than the current code IMO.