Bug 129361 - Avoid unnecessary HTML Collection invalidations for id and name attribute changes
Summary: Avoid unnecessary HTML Collection invalidations for id and name attribute cha...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 129365
  Show dependency treegraph
 
Reported: 2014-02-25 20:50 PST by Ryosuke Niwa
Modified: 2014-02-26 00:20 PST (History)
3 users (show)

See Also:


Attachments
Fixes the bug (13.78 KB, patch)
2014-02-25 21:02 PST, Ryosuke Niwa
benjamin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2014-02-25 20:50:58 PST
Avoid unnecessary HTML Collection invalidations for id and name attribute changes
Comment 1 Ryosuke Niwa 2014-02-25 21:02:46 PST
Created attachment 225218 [details]
Fixes the bug
Comment 2 Benjamin Poulain 2014-02-25 23:54:08 PST
Comment on attachment 225218 [details]
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=225218&action=review

> Source/WebCore/dom/NodeRareData.h:233
> +        for (auto it = m_atomicNameCaches.begin(), end = m_atomicNameCaches.end(); it != end; ++it) {

You  could use a for-each loop here and in the following loops.

> Source/WebCore/dom/NodeRareData.h:237
> +            list.invalidateCache(0);

Shouldn't you just call list.invalidateCache() here?
Comment 3 Ryosuke Niwa 2014-02-26 00:19:11 PST
Thanks for the review.

(In reply to comment #2)
> (From update of attachment 225218 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=225218&action=review
> 
> > Source/WebCore/dom/NodeRareData.h:233
> > +        for (auto it = m_atomicNameCaches.begin(), end = m_atomicNameCaches.end(); it != end; ++it) {
> 
> You  could use a for-each loop here and in the following loops.

Fixed.

> > Source/WebCore/dom/NodeRareData.h:237
> > +            list.invalidateCache(0);
> 
> Shouldn't you just call list.invalidateCache() here?

Fixed.
Comment 4 Ryosuke Niwa 2014-02-26 00:20:48 PST
Committed r164707: <http://trac.webkit.org/changeset/164707>