RESOLVED FIXED 74768
Cache and reuse the HTMLAllCollection returned by document.all.
https://bugs.webkit.org/show_bug.cgi?id=74768
Summary Cache and reuse the HTMLAllCollection returned by document.all.
Andreas Kling
Reported 2011-12-16 16:41:50 PST
document.all should behave like the other collections on document (multiple calls return the same objects.)
Attachments
Patch (12.97 KB, patch)
2011-12-16 16:50 PST, Andreas Kling
kling: review-
Patch v2 (11.18 KB, patch)
2011-12-17 09:06 PST, Andreas Kling
koivisto: review+
Andreas Kling
Comment 1 2011-12-16 16:50:24 PST
Andreas Kling
Comment 2 2011-12-16 19:30:38 PST
Comment on attachment 119699 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=119699&action=review > Source/WebCore/html/HTMLCollection.cpp:70 > - if (m_baseIsRetained) > + if (!m_base->isDocumentNode()) Gnarf! This isn't correct, isDocumentNode() will be false after ~Document() runs (if the HTMLCollection is being destroyed after the Document removed the last ref.)
Andreas Kling
Comment 3 2011-12-17 09:06:28 PST
Created attachment 119726 [details] Patch v2 Keep the m_baseIsRetained logic in HTMLCollection, since we can't depend on calling Node::isDocumentNode() after ~Document(). m_baseIsRetained can go away by making all HTMLCollections cached instead, since the collection will then never hold a ref on its base node.
Antti Koivisto
Comment 4 2011-12-17 18:45:16 PST
Comment on attachment 119726 [details] Patch v2 r=me The ChangeLog could use a sentence or two about why this is a good thing. Bonus points for some performance measurements.
Andreas Kling
Comment 5 2011-12-17 19:58:05 PST
Note You need to log in before you can comment on or make changes to this bug.