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

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

Issue 143453010: Have getElementsByClassName() / getElementsByTagName*() return an HTMLCollection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Null HTMLCollection handling Created 6 years, 11 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/TagCollection.cpp
diff --git a/Source/core/dom/TagNodeList.cpp b/Source/core/dom/TagCollection.cpp
similarity index 75%
rename from Source/core/dom/TagNodeList.cpp
rename to Source/core/dom/TagCollection.cpp
index 2df54f5e05fc6264ada000a93e94f9090d5e1075..169e2a35f268d23f67b471f3bd7d362f6ba2b40b 100644
--- a/Source/core/dom/TagNodeList.cpp
+++ b/Source/core/dom/TagCollection.cpp
@@ -22,22 +22,22 @@
*/
#include "config.h"
-#include "core/dom/TagNodeList.h"
+#include "core/dom/TagCollection.h"
#include "core/dom/NodeRareData.h"
#include "wtf/Assertions.h"
namespace WebCore {
-TagNodeList::TagNodeList(PassRefPtr<ContainerNode> rootNode, CollectionType type, const AtomicString& namespaceURI, const AtomicString& localName)
- : LiveNodeList(rootNode, type, DoNotInvalidateOnAttributeChanges)
+TagCollection::TagCollection(ContainerNode* rootNode, CollectionType type, const AtomicString& namespaceURI, const AtomicString& localName)
+ : HTMLCollection(rootNode, type, DoesNotOverrideItemAfter)
, m_namespaceURI(namespaceURI)
, m_localName(localName)
{
ASSERT(m_namespaceURI.isNull() || !m_namespaceURI.isEmpty());
}
-TagNodeList::~TagNodeList()
+TagCollection::~TagCollection()
{
if (m_namespaceURI == starAtom)
ownerNode()->nodeLists()->removeCacheWithAtomicName(this, type(), m_localName);
@@ -45,7 +45,7 @@ TagNodeList::~TagNodeList()
ownerNode()->nodeLists()->removeCacheWithQualifiedName(this, m_namespaceURI, m_localName);
}
-bool TagNodeList::nodeMatches(const Element& testNode) const
+bool TagCollection::elementMatches(const Element& testNode) const
{
// Implements http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-getelementsbytagnamens
if (m_localName != starAtom && m_localName != testNode.localName())
@@ -54,15 +54,10 @@ bool TagNodeList::nodeMatches(const Element& testNode) const
return m_namespaceURI == starAtom || m_namespaceURI == testNode.namespaceURI();
}
-HTMLTagNodeList::HTMLTagNodeList(PassRefPtr<ContainerNode> rootNode, const AtomicString& localName)
- : TagNodeList(rootNode, HTMLTagNodeListType, starAtom, localName)
+HTMLTagCollection::HTMLTagCollection(ContainerNode* rootNode, const AtomicString& localName)
+ : TagCollection(rootNode, HTMLTagCollectionType, starAtom, localName)
, m_loweredLocalName(localName.lower())
{
}
-bool HTMLTagNodeList::nodeMatches(const Element& testNode) const
-{
- return nodeMatchesInlined(testNode);
-}
-
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698