Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Issue 247263008: LiveNodeListBase code should not need to worry about id/name cache invalidation (Closed)

Created:
6 years, 8 months ago by Inactive
Modified:
6 years, 8 months ago
Reviewers:
esprehn, adamk
CC:
blink-reviews, sof, eae+blinkwatch, dglazkov+blink, adamk+blink_chromium.org, Inactive, ojan, rwlbuis
Visibility:
Public.

Description

LiveNodeListBase code should not need to worry about id/name cache invalidation LiveNodeListBase code should not need to worry about id/name cache invalidation. Previously, LiveNodeListBase::invalidateCache(QualifiedName) would explicitly handle the case where the nodelist has a id/name cache (i.e. it is an HTMLCollection) and then invalidate it. The following changes were made to avoid this: - Add invalidateCacheForAttribute() methods to HTMLCollection and LiveNodeList classes and let them handle cache invalidation. HTMLCollection's method is the only one that takes care of invalidating the id/name cache if needed. - The invalidateCacheForAttribute() method in LiveNodeListBase calls the corresponding method on the right subclass using the m_collectionType member. We could make it virtual but cache invalidation can be hot and this causes slight regressions in Dromaeo. - Remove any traces of id/name caching from LiveNodeListBase. - Use DEFINE_TYPE_CASTS() macro to define casting functions for HTMLCollection and LiveNodeList, so that we no longer need to do manual casting. - LiveNodeListBase no longer needs to be a friend class of HTMLCollection. Also, the method was renamed to invalidateCacheForAttribute() for clarity and to distinguish it better from the invalidateCache(Document*) one. I see no performance regression on Dromaeo DOM tests: http://dromaeo.com/?id=220318,220326 R=esprehn@chromium.org, adamk@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=172440

Patch Set 1 #

Patch Set 2 : Bug fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -21 lines) Patch
M Source/core/dom/Document.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/LiveNodeList.h View 2 chunks +11 lines, -1 line 0 comments Download
M Source/core/dom/LiveNodeListBase.h View 2 chunks +2 lines, -10 lines 0 comments Download
M Source/core/dom/LiveNodeListBase.cpp View 1 2 chunks +9 lines, -6 lines 0 comments Download
M Source/core/dom/NodeRareData.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/CollectionType.h View 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/html/HTMLCollection.h View 2 chunks +11 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Inactive
6 years, 8 months ago (2014-04-22 23:08:07 UTC) #1
adamk
lgtm
6 years, 8 months ago (2014-04-24 00:14:33 UTC) #2
Inactive
The CQ bit was checked by ch.dumez@samsung.com
6 years, 8 months ago (2014-04-24 01:09:52 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/247263008/20001
6 years, 8 months ago (2014-04-24 01:10:10 UTC) #4
commit-bot: I haz the power
6 years, 8 months ago (2014-04-24 02:58:03 UTC) #5
Message was sent while issue was closed.
Change committed as 172440

Powered by Google App Engine
This is Rietveld 408576698