Summary: | Cache and reuse the HTMLAllCollection returned by document.all. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Andreas Kling <kling> | ||||||
Component: | DOM | Assignee: | Andreas Kling <kling> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | abarth, japhet, koivisto, ojan, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Andreas Kling
2011-12-16 16:41:50 PST
Created attachment 119699 [details]
Patch
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.) 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.
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.
Committed r103166: <http://trac.webkit.org/changeset/103166> |