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

Unified Diff: third_party/WebKit/Source/core/html/HTMLCollection.h

Issue 1674273004: Do not re-register cached id-name HTMLCollection at same invalidation type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added test Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLCollection.h
diff --git a/third_party/WebKit/Source/core/html/HTMLCollection.h b/third_party/WebKit/Source/core/html/HTMLCollection.h
index 35f4b5496821add31de8cb9673c5afe795c22c86..8ea1e44467c4370966fdf2d03adde76be38448eb 100644
--- a/third_party/WebKit/Source/core/html/HTMLCollection.h
+++ b/third_party/WebKit/Source/core/html/HTMLCollection.h
@@ -117,7 +117,9 @@ protected:
void setNamedItemCache(PassOwnPtrWillBeRawPtr<NamedItemCache> cache) const
{
ASSERT(!m_namedItemCache);
- document().registerNodeListWithIdNameCache(this);
+ // Do not repeat registration for the same invalidation type.
+ if (invalidationType() != InvalidateOnIdNameAttrChange)
+ document().registerNodeListWithIdNameCache(this);
m_namedItemCache = std::move(cache);
}
@@ -144,7 +146,9 @@ private:
void unregisterIdNameCacheFromDocument(Document& document) const
{
ASSERT(hasValidIdNameCache());
- document.unregisterNodeListWithIdNameCache(this);
+ // Do not repeat unregistration for the same invalidation type.
+ if (invalidationType() != InvalidateOnIdNameAttrChange)
+ document.unregisterNodeListWithIdNameCache(this);
}
const unsigned m_overridesItemAfter : 1;
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698