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

Unified Diff: Source/core/dom/ContainerNode.cpp

Issue 176933013: Pass rootNode by reference when constructing node lists / collections (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 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 | « Source/core/dom/ClassCollection.cpp ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContainerNode.cpp
diff --git a/Source/core/dom/ContainerNode.cpp b/Source/core/dom/ContainerNode.cpp
index adfe5e6d806cc1c2fa010b5eba18d320104e2bcf..7ec301488b855d3d83dc1b3345c649dd11f892b9 100644
--- a/Source/core/dom/ContainerNode.cpp
+++ b/Source/core/dom/ContainerNode.cpp
@@ -885,7 +885,7 @@ void ContainerNode::setHovered(bool over)
PassRefPtr<HTMLCollection> ContainerNode::children()
{
- return ensureRareData().ensureNodeLists().addCache<HTMLCollection>(this, NodeChildren);
+ return ensureRareData().ensureNodeLists().addCache<HTMLCollection>(*this, NodeChildren);
}
unsigned ContainerNode::countChildren() const
@@ -1000,8 +1000,8 @@ PassRefPtr<HTMLCollection> ContainerNode::getElementsByTagName(const AtomicStrin
return nullptr;
if (document().isHTMLDocument())
- return ensureRareData().ensureNodeLists().addCache<HTMLTagCollection>(this, HTMLTagCollectionType, localName);
- return ensureRareData().ensureNodeLists().addCache<TagCollection>(this, TagCollectionType, localName);
+ return ensureRareData().ensureNodeLists().addCache<HTMLTagCollection>(*this, HTMLTagCollectionType, localName);
+ return ensureRareData().ensureNodeLists().addCache<TagCollection>(*this, TagCollectionType, localName);
}
PassRefPtr<HTMLCollection> ContainerNode::getElementsByTagNameNS(const AtomicString& namespaceURI, const AtomicString& localName)
@@ -1012,28 +1012,28 @@ PassRefPtr<HTMLCollection> ContainerNode::getElementsByTagNameNS(const AtomicStr
if (namespaceURI == starAtom)
return getElementsByTagName(localName);
- return ensureRareData().ensureNodeLists().addCache(this, namespaceURI.isEmpty() ? nullAtom : namespaceURI, localName);
+ return ensureRareData().ensureNodeLists().addCache(*this, namespaceURI.isEmpty() ? nullAtom : namespaceURI, localName);
}
// Takes an AtomicString in argument because it is common for elements to share the same name attribute.
// Therefore, the NameNodeList factory function expects an AtomicString type.
PassRefPtr<NodeList> ContainerNode::getElementsByName(const AtomicString& elementName)
{
- return ensureRareData().ensureNodeLists().addCache<NameNodeList>(this, NameNodeListType, elementName);
+ return ensureRareData().ensureNodeLists().addCache<NameNodeList>(*this, NameNodeListType, elementName);
}
// Takes an AtomicString in argument because it is common for elements to share the same set of class names.
// Therefore, the ClassNodeList factory function expects an AtomicString type.
PassRefPtr<HTMLCollection> ContainerNode::getElementsByClassName(const AtomicString& classNames)
{
- return ensureRareData().ensureNodeLists().addCache<ClassCollection>(this, ClassCollectionType, classNames);
+ return ensureRareData().ensureNodeLists().addCache<ClassCollection>(*this, ClassCollectionType, classNames);
}
PassRefPtr<RadioNodeList> ContainerNode::radioNodeList(const AtomicString& name, bool onlyMatchImgElements)
{
ASSERT(hasTagName(formTag) || hasTagName(fieldsetTag));
CollectionType type = onlyMatchImgElements ? RadioImgNodeListType : RadioNodeListType;
- return ensureRareData().ensureNodeLists().addCache<RadioNodeList>(this, type, name);
+ return ensureRareData().ensureNodeLists().addCache<RadioNodeList>(*this, type, name);
}
#ifndef NDEBUG
« no previous file with comments | « Source/core/dom/ClassCollection.cpp ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698