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

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

Issue 334713006: Use stricter typing for NodeLists throughout the code base (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix typo Created 6 years, 6 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
Index: Source/core/dom/ContainerNode.cpp
diff --git a/Source/core/dom/ContainerNode.cpp b/Source/core/dom/ContainerNode.cpp
index 837a135f602df0890efc15cd5b3961e536ee53b3..d13de22d0d5602676325ea4c184f96becbdcf15f 100644
--- a/Source/core/dom/ContainerNode.cpp
+++ b/Source/core/dom/ContainerNode.cpp
@@ -39,6 +39,7 @@
#include "core/dom/NodeTraversal.h"
#include "core/dom/ScriptForbiddenScope.h"
#include "core/dom/SelectorQuery.h"
+#include "core/dom/StaticNodeList.h"
#include "core/dom/shadow/ElementShadow.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/MutationEvent.h"
@@ -1023,7 +1024,7 @@ PassRefPtrWillBeRawPtr<Element> ContainerNode::querySelector(const AtomicString&
return selectorQuery->queryFirst(*this);
}
-PassRefPtrWillBeRawPtr<NodeList> ContainerNode::querySelectorAll(const AtomicString& selectors, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<StaticNodeList> ContainerNode::querySelectorAll(const AtomicString& selectors, ExceptionState& exceptionState)
{
if (selectors.isEmpty()) {
exceptionState.throwDOMException(SyntaxError, "The provided selector is empty.");
@@ -1215,7 +1216,7 @@ void ContainerNode::checkForSiblingStyleChanges(bool finishedParsingCallback, No
}
}
-PassRefPtrWillBeRawPtr<HTMLCollection> ContainerNode::getElementsByTagName(const AtomicString& localName)
+PassRefPtrWillBeRawPtr<TagCollection> ContainerNode::getElementsByTagName(const AtomicString& localName)
{
if (localName.isNull())
return nullptr;
@@ -1225,7 +1226,7 @@ PassRefPtrWillBeRawPtr<HTMLCollection> ContainerNode::getElementsByTagName(const
return ensureRareData().ensureNodeLists().addCache<TagCollection>(*this, TagCollectionType, localName);
}
-PassRefPtrWillBeRawPtr<HTMLCollection> ContainerNode::getElementsByTagNameNS(const AtomicString& namespaceURI, const AtomicString& localName)
+PassRefPtrWillBeRawPtr<TagCollection> ContainerNode::getElementsByTagNameNS(const AtomicString& namespaceURI, const AtomicString& localName)
{
if (localName.isNull())
return nullptr;
@@ -1238,14 +1239,14 @@ PassRefPtrWillBeRawPtr<HTMLCollection> ContainerNode::getElementsByTagNameNS(con
// 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.
-PassRefPtrWillBeRawPtr<NodeList> ContainerNode::getElementsByName(const AtomicString& elementName)
+PassRefPtrWillBeRawPtr<NameNodeList> ContainerNode::getElementsByName(const AtomicString& 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.
-PassRefPtrWillBeRawPtr<HTMLCollection> ContainerNode::getElementsByClassName(const AtomicString& classNames)
+PassRefPtrWillBeRawPtr<ClassCollection> ContainerNode::getElementsByClassName(const AtomicString& classNames)
{
return ensureRareData().ensureNodeLists().addCache<ClassCollection>(*this, ClassCollectionType, classNames);
}

Powered by Google App Engine
This is Rietveld 408576698