This source file includes following definitions.
- m_localName
- elementMatches
- m_loweredLocalName
#include "config.h"
#include "core/dom/TagCollection.h"
#include "core/dom/NodeRareData.h"
#include "wtf/Assertions.h"
namespace WebCore {
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());
}
TagCollection::~TagCollection()
{
if (m_namespaceURI == starAtom)
ownerNode().nodeLists()->removeCache(this, type(), m_localName);
else
ownerNode().nodeLists()->removeCache(this, m_namespaceURI, m_localName);
}
bool TagCollection::elementMatches(const Element& testNode) const
{
if (m_localName != starAtom && m_localName != testNode.localName())
return false;
return m_namespaceURI == starAtom || m_namespaceURI == testNode.namespaceURI();
}
HTMLTagCollection::HTMLTagCollection(ContainerNode& rootNode, const AtomicString& localName)
: TagCollection(rootNode, HTMLTagCollectionType, starAtom, localName)
, m_loweredLocalName(localName.lower())
{
}
}