Diff
Modified: trunk/Source/WebCore/ChangeLog (135475 => 135476)
--- trunk/Source/WebCore/ChangeLog 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/ChangeLog 2012-11-22 06:18:24 UTC (rev 135476)
@@ -1,3 +1,66 @@
+2012-11-21 Ryosuke Niwa <[email protected]>
+
+ CollectionType and DynamicNodeList::NodeListType should be merged
+ https://bugs.webkit.org/show_bug.cgi?id=102983
+
+ Reviewed by Antti Koivisto.
+
+ Merged DynamicNodeList::NodeListType (for live NodeList) into CollectionType.
+
+ * dom/ClassNodeList.cpp:
+ (WebCore::ClassNodeList::~ClassNodeList):
+ * dom/Document.cpp:
+ (WebCore::Document::registerNodeListCache):
+ (WebCore::Document::unregisterNodeListCache):
+ (WebCore::Document::getItems):
+ * dom/DynamicNodeList.cpp:
+ (WebCore::DynamicNodeListCacheBase::invalidateCache):
+ (WebCore::DynamicNodeListCacheBase::invalidateIdNameCacheMaps):
+ * dom/DynamicNodeList.h:
+ (WebCore::DynamicNodeListCacheBase::DynamicNodeListCacheBase):
+ (WebCore::DynamicNodeListCacheBase::hasIdNameCache): Added. Returns iff this is a HTMLCollection.
+ (WebCore::DynamicNodeListCacheBase::invalidateCache):
+ (WebCore::DynamicNodeList::DynamicNodeList):
+ (WebCore::DynamicSubtreeNodeList::DynamicSubtreeNodeList):
+ * dom/MicroDataItemList.cpp:
+ (WebCore::MicroDataItemList::~MicroDataItemList):
+ * dom/NameNodeList.cpp:
+ (WebCore::NameNodeList::~NameNodeList):
+ * dom/Node.cpp:
+ (WebCore::Node::getElementsByTagName):
+ (WebCore::Node::getElementsByName):
+ (WebCore::Node::getElementsByClassName):
+ (WebCore::Node::radioNodeList):
+ (WebCore::Node::propertyNodeList):
+ * dom/NodeRareData.h:
+ (WebCore::NodeListsNodeData::addCacheWithAtomicName): No longer converts CollectionType to
+ a NodeListType equivalent since two enums have been merged.
+ (WebCore::NodeListsNodeData::cacheWithAtomicName): Ditto.
+ (WebCore::NodeListsNodeData::addCacheWithName): Ditto.
+ (WebCore::NodeListsNodeData::removeCacheWithAtomicName): Ditto.
+ (WebCore::NodeListsNodeData::removeCacheWithName): Ditto.
+ (WebCore::NodeListsNodeData::namedNodeListKey): Ignore types before FirstNodeCollectionType
+ to minimize the hash conflicts.
+ * dom/PropertyNodeList.cpp:
+ (WebCore::PropertyNodeList::~PropertyNodeList):
+ * dom/TagNodeList.cpp:
+ (WebCore::TagNodeList::~TagNodeList):
+ * html/CollectionType.h:
+ (WebCore::isNodeList): Added.
+ * html/HTMLCollection.cpp:
+ (WebCore::shouldOnlyIncludeDirectChildren):
+ (WebCore::rootTypeFromCollectionType):
+ (WebCore::invalidationTypeExcludingIdAndNameAttributes):
+ (WebCore::isAcceptableElement):
+ (WebCore::DynamicNodeListCacheBase::iterateForNextNode):
+ (WebCore::DynamicNodeListCacheBase::itemBeforeOrAfter):
+ * html/LabelableElement.cpp:
+ (WebCore::LabelableElement::labels):
+ * html/LabelsNodeList.cpp:
+ (WebCore::LabelsNodeList::~LabelsNodeList):
+ * html/RadioNodeList.cpp:
+ (WebCore::RadioNodeList::~RadioNodeList):
+
2012-11-21 Michael Pruett <[email protected]>
IndexedDB: Obtain ScriptState from IDL binding generator
Modified: trunk/Source/WebCore/dom/ClassNodeList.cpp (135475 => 135476)
--- trunk/Source/WebCore/dom/ClassNodeList.cpp 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/dom/ClassNodeList.cpp 2012-11-22 06:18:24 UTC (rev 135476)
@@ -45,7 +45,7 @@
ClassNodeList::~ClassNodeList()
{
- ownerNode()->nodeLists()->removeCacheWithName(this, DynamicNodeList::ClassNodeListType, m_originalClassNames);
+ ownerNode()->nodeLists()->removeCacheWithName(this, ClassNodeListType, m_originalClassNames);
}
bool ClassNodeList::nodeMatches(Element* testNode) const
Modified: trunk/Source/WebCore/dom/Document.cpp (135475 => 135476)
--- trunk/Source/WebCore/dom/Document.cpp 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/dom/Document.cpp 2012-11-22 06:18:24 UTC (rev 135476)
@@ -3462,7 +3462,7 @@
void Document::registerNodeListCache(DynamicNodeListCacheBase* list)
{
- if (list->type() != NodeListCollectionType)
+ if (list->hasIdNameCache())
m_nodeListCounts[InvalidateOnIdNameAttrChange]++;
m_nodeListCounts[list->invalidationType()]++;
if (list->isRootedAtDocument())
@@ -3471,7 +3471,7 @@
void Document::unregisterNodeListCache(DynamicNodeListCacheBase* list)
{
- if (list->type() != NodeListCollectionType)
+ if (list->hasIdNameCache())
m_nodeListCounts[InvalidateOnIdNameAttrChange]--;
m_nodeListCounts[list->invalidationType()]--;
if (list->isRootedAtDocument()) {
@@ -5682,7 +5682,7 @@
// In this case we need to create an empty string identifier to map such request in the cache.
String localTypeNames = typeNames.isNull() ? MicroDataItemList::undefinedItemType() : typeNames;
- return ensureRareData()->ensureNodeLists()->addCacheWithName<MicroDataItemList>(this, DynamicNodeList::MicroDataItemListType, localTypeNames);
+ return ensureRareData()->ensureNodeLists()->addCacheWithName<MicroDataItemList>(this, MicroDataItemListType, localTypeNames);
}
#endif
Modified: trunk/Source/WebCore/dom/DynamicNodeList.cpp (135475 => 135476)
--- trunk/Source/WebCore/dom/DynamicNodeList.cpp 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/dom/DynamicNodeList.cpp 2012-11-22 06:18:24 UTC (rev 135476)
@@ -56,7 +56,7 @@
m_isItemCacheValid = false;
m_isNameCacheValid = false;
m_isItemRefElementsCacheValid = false;
- if (type() == NodeListCollectionType)
+ if (isNodeList(type()))
return;
const HTMLCollectionCacheBase* cacheBase = static_cast<const HTMLCollectionCacheBase*>(this);
@@ -73,7 +73,7 @@
void DynamicNodeListCacheBase::invalidateIdNameCacheMaps() const
{
- ASSERT(type() != NodeListCollectionType);
+ ASSERT(hasIdNameCache());
const HTMLCollectionCacheBase* cacheBase = static_cast<const HTMLCollectionCacheBase*>(this);
cacheBase->m_idCache.clear();
cacheBase->m_nameCache.clear();
@@ -95,7 +95,7 @@
if (rootNode->inDocument()) {
#if ENABLE(MICRODATA)
- if (rootType() == NodeListIsRootedAtDocumentIfOwnerHasItemrefAttr)
+ if (type() == PropertyNodeListType)
static_cast<const PropertyNodeList*>(this)->updateRefElements();
#endif
Modified: trunk/Source/WebCore/dom/DynamicNodeList.h (135475 => 135476)
--- trunk/Source/WebCore/dom/DynamicNodeList.h 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/dom/DynamicNodeList.h 2012-11-22 06:18:24 UTC (rev 135476)
@@ -64,10 +64,11 @@
ASSERT(m_rootType == static_cast<unsigned>(rootType));
ASSERT(m_invalidationType == static_cast<unsigned>(invalidationType));
ASSERT(m_collectionType == static_cast<unsigned>(collectionType));
- ASSERT(!m_overridesItemAfter || m_collectionType != NodeListCollectionType);
+ ASSERT(!m_overridesItemAfter || !isNodeList(collectionType));
}
public:
+ ALWAYS_INLINE bool hasIdNameCache() const { return !isNodeList(type()); }
ALWAYS_INLINE bool isRootedAtDocument() const { return m_rootType == NodeListIsRootedAtDocument || m_rootType == NodeListIsRootedAtDocumentIfOwnerHasItemrefAttr; }
ALWAYS_INLINE NodeListInvalidationType invalidationType() const { return static_cast<NodeListInvalidationType>(m_invalidationType); }
ALWAYS_INLINE CollectionType type() const { return static_cast<CollectionType>(m_collectionType); }
@@ -76,7 +77,7 @@
{
if (!attrName || shouldInvalidateTypeOnAttributeChange(invalidationType(), *attrName))
invalidateCache();
- else if (type() != NodeListCollectionType && (*attrName == HTMLNames::idAttr || *attrName == HTMLNames::nameAttr))
+ else if (hasIdNameCache() && (*attrName == HTMLNames::idAttr || *attrName == HTMLNames::nameAttr))
invalidateIdNameCacheMaps();
}
void invalidateCache() const;
@@ -190,19 +191,9 @@
class DynamicNodeList : public NodeList, public DynamicNodeListCacheBase {
public:
- enum NodeListType {
- ChildNodeListType,
- ClassNodeListType,
- NameNodeListType,
- TagNodeListType,
- RadioNodeListType,
- LabelsNodeListType,
- MicroDataItemListType,
- PropertyNodeListType,
- PastLastNodeListType,
- };
- DynamicNodeList(PassRefPtr<Node> ownerNode, NodeListType type, NodeListRootType rootType, NodeListInvalidationType invalidationType)
- : DynamicNodeListCacheBase(ownerNode.get(), rootType, invalidationType, type == ChildNodeListType, NodeListCollectionType, DoesNotOverrideItemAfter)
+ DynamicNodeList(PassRefPtr<Node> ownerNode, CollectionType collectionType, NodeListRootType rootType, NodeListInvalidationType invalidationType)
+ : DynamicNodeListCacheBase(ownerNode.get(), rootType, invalidationType, collectionType == ChildNodeListType,
+ collectionType, DoesNotOverrideItemAfter)
{ }
virtual ~DynamicNodeList() { }
@@ -226,7 +217,7 @@
}
protected:
- DynamicSubtreeNodeList(PassRefPtr<Node> node, NodeListType type, NodeListInvalidationType invalidationType, NodeListRootType rootType = NodeListIsRootedAtNode)
+ DynamicSubtreeNodeList(PassRefPtr<Node> node, CollectionType type, NodeListInvalidationType invalidationType, NodeListRootType rootType = NodeListIsRootedAtNode)
: DynamicNodeList(node, type, rootType, invalidationType)
{
document()->registerNodeListCache(this);
Modified: trunk/Source/WebCore/dom/MicroDataItemList.cpp (135475 => 135476)
--- trunk/Source/WebCore/dom/MicroDataItemList.cpp 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/dom/MicroDataItemList.cpp 2012-11-22 06:18:24 UTC (rev 135476)
@@ -52,7 +52,7 @@
MicroDataItemList::~MicroDataItemList()
{
- ownerNode()->nodeLists()->removeCacheWithName(this, DynamicNodeList::MicroDataItemListType, m_originalTypeNames);
+ ownerNode()->nodeLists()->removeCacheWithName(this, MicroDataItemListType, m_originalTypeNames);
}
bool MicroDataItemList::nodeMatches(Element* testNode) const
Modified: trunk/Source/WebCore/dom/NameNodeList.cpp (135475 => 135476)
--- trunk/Source/WebCore/dom/NameNodeList.cpp 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/dom/NameNodeList.cpp 2012-11-22 06:18:24 UTC (rev 135476)
@@ -40,7 +40,7 @@
NameNodeList::~NameNodeList()
{
- ownerNode()->nodeLists()->removeCacheWithAtomicName(this, DynamicNodeList::NameNodeListType, m_name);
+ ownerNode()->nodeLists()->removeCacheWithAtomicName(this, NameNodeListType, m_name);
}
bool NameNodeList::nodeMatches(Element* testNode) const
Modified: trunk/Source/WebCore/dom/Node.cpp (135475 => 135476)
--- trunk/Source/WebCore/dom/Node.cpp 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/dom/Node.cpp 2012-11-22 06:18:24 UTC (rev 135476)
@@ -1567,8 +1567,8 @@
return 0;
if (document()->isHTMLDocument())
- return ensureRareData()->ensureNodeLists()->addCacheWithAtomicName<HTMLTagNodeList>(this, DynamicNodeList::TagNodeListType, localName);
- return ensureRareData()->ensureNodeLists()->addCacheWithAtomicName<TagNodeList>(this, DynamicNodeList::TagNodeListType, localName);
+ return ensureRareData()->ensureNodeLists()->addCacheWithAtomicName<HTMLTagNodeList>(this, TagNodeListType, localName);
+ return ensureRareData()->ensureNodeLists()->addCacheWithAtomicName<TagNodeList>(this, TagNodeListType, localName);
}
PassRefPtr<NodeList> Node::getElementsByTagNameNS(const AtomicString& namespaceURI, const AtomicString& localName)
@@ -1584,18 +1584,18 @@
PassRefPtr<NodeList> Node::getElementsByName(const String& elementName)
{
- return ensureRareData()->ensureNodeLists()->addCacheWithAtomicName<NameNodeList>(this, DynamicNodeList::NameNodeListType, elementName);
+ return ensureRareData()->ensureNodeLists()->addCacheWithAtomicName<NameNodeList>(this, NameNodeListType, elementName);
}
PassRefPtr<NodeList> Node::getElementsByClassName(const String& classNames)
{
- return ensureRareData()->ensureNodeLists()->addCacheWithName<ClassNodeList>(this, DynamicNodeList::ClassNodeListType, classNames);
+ return ensureRareData()->ensureNodeLists()->addCacheWithName<ClassNodeList>(this, ClassNodeListType, classNames);
}
PassRefPtr<RadioNodeList> Node::radioNodeList(const AtomicString& name)
{
ASSERT(hasTagName(formTag) || hasTagName(fieldsetTag));
- return ensureRareData()->ensureNodeLists()->addCacheWithAtomicName<RadioNodeList>(this, DynamicNodeList::RadioNodeListType, name);
+ return ensureRareData()->ensureNodeLists()->addCacheWithAtomicName<RadioNodeList>(this, RadioNodeListType, name);
}
PassRefPtr<Element> Node::querySelector(const AtomicString& selectors, ExceptionCode& ec)
@@ -2787,7 +2787,7 @@
PassRefPtr<PropertyNodeList> Node::propertyNodeList(const String& name)
{
- return ensureRareData()->ensureNodeLists()->addCacheWithName<PropertyNodeList>(this, DynamicNodeList::PropertyNodeListType, name);
+ return ensureRareData()->ensureNodeLists()->addCacheWithName<PropertyNodeList>(this, PropertyNodeListType, name);
}
#endif
Modified: trunk/Source/WebCore/dom/NodeRareData.h (135475 => 135476)
--- trunk/Source/WebCore/dom/NodeRareData.h 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/dom/NodeRareData.h 2012-11-22 06:18:24 UTC (rev 135476)
@@ -64,9 +64,9 @@
typedef HashMap<QualifiedName, TagNodeList*> TagNodeListCacheNS;
template<typename T>
- PassRefPtr<T> addCacheWithAtomicName(Node* node, DynamicNodeList::NodeListType listType, const AtomicString& name)
+ PassRefPtr<T> addCacheWithAtomicName(Node* node, CollectionType collectionType, const AtomicString& name)
{
- NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.add(namedNodeListKey(listType, name), 0);
+ NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.add(namedNodeListKey(collectionType, name), 0);
if (!result.isNewEntry)
return static_cast<T*>(result.iterator->value);
@@ -78,8 +78,7 @@
template<typename T>
PassRefPtr<T> addCacheWithAtomicName(Element* node, CollectionType collectionType)
{
- unsigned char type = DynamicNodeList::PastLastNodeListType + collectionType - FirstNodeCollectionType;
- NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.add(namedNodeListKey(type, starAtom), 0);
+ NodeListAtomicNameCacheMap::AddResult result = m_atomicNameCaches.add(namedNodeListKey(collectionType, starAtom), 0);
if (!result.isNewEntry)
return static_cast<T*>(result.iterator->value);
@@ -91,14 +90,13 @@
template<typename T>
T* cacheWithAtomicName(CollectionType collectionType)
{
- unsigned char type = DynamicNodeList::PastLastNodeListType + collectionType - FirstNodeCollectionType;
- return static_cast<T*>(m_atomicNameCaches.get(namedNodeListKey(type, starAtom)));
+ return static_cast<T*>(m_atomicNameCaches.get(namedNodeListKey(collectionType, starAtom)));
}
template<typename T>
- PassRefPtr<T> addCacheWithName(Node* node, DynamicNodeList::NodeListType listType, const String& name)
+ PassRefPtr<T> addCacheWithName(Node* node, CollectionType collectionType, const String& name)
{
- NodeListNameCacheMap::AddResult result = m_nameCaches.add(namedNodeListKey(listType, name), 0);
+ NodeListNameCacheMap::AddResult result = m_nameCaches.add(namedNodeListKey(collectionType, name), 0);
if (!result.isNewEntry)
return static_cast<T*>(result.iterator->value);
@@ -119,25 +117,18 @@
return list.release();
}
- void removeCacheWithAtomicName(DynamicNodeListCacheBase* list, DynamicNodeList::NodeListType listType, const AtomicString& name)
+ void removeCacheWithAtomicName(DynamicNodeListCacheBase* list, CollectionType collectionType, const AtomicString& name = starAtom)
{
- ASSERT_UNUSED(list, list == m_atomicNameCaches.get(namedNodeListKey(listType, name)));
- m_atomicNameCaches.remove(namedNodeListKey(listType, name));
+ ASSERT_UNUSED(list, list == m_atomicNameCaches.get(namedNodeListKey(collectionType, name)));
+ m_atomicNameCaches.remove(namedNodeListKey(collectionType, name));
}
- void removeCacheWithAtomicName(DynamicNodeListCacheBase* list, CollectionType collectionType)
+ void removeCacheWithName(DynamicSubtreeNodeList* list, CollectionType collectionType, const String& name)
{
- unsigned char type = DynamicNodeList::PastLastNodeListType + collectionType - FirstNodeCollectionType;
- ASSERT_UNUSED(list, list == m_atomicNameCaches.get(namedNodeListKey(type, starAtom)));
- m_atomicNameCaches.remove(namedNodeListKey(type, starAtom));
+ ASSERT_UNUSED(list, list == m_nameCaches.get(namedNodeListKey(collectionType, name)));
+ m_nameCaches.remove(namedNodeListKey(collectionType, name));
}
- void removeCacheWithName(DynamicSubtreeNodeList* list, DynamicNodeList::NodeListType listType, const String& name)
- {
- ASSERT_UNUSED(list, list == m_nameCaches.get(namedNodeListKey(listType, name)));
- m_nameCaches.remove(namedNodeListKey(listType, name));
- }
-
void removeCacheWithQualifiedName(DynamicSubtreeNodeList* list, const AtomicString& namespaceURI, const AtomicString& localName)
{
QualifiedName name(nullAtom, localName, namespaceURI);
@@ -190,14 +181,16 @@
private:
NodeListsNodeData() { }
- std::pair<unsigned char, AtomicString> namedNodeListKey(unsigned char listType, const AtomicString& name)
+ std::pair<unsigned char, AtomicString> namedNodeListKey(CollectionType type, const AtomicString& name)
{
- return std::pair<unsigned char, AtomicString>(listType, name);
+ ASSERT(type >= FirstNodeCollectionType);
+ return std::pair<unsigned char, AtomicString>(type - FirstNodeCollectionType, name);
}
- std::pair<unsigned char, String> namedNodeListKey(unsigned char listType, const String& name)
+ std::pair<unsigned char, String> namedNodeListKey(CollectionType type, const String& name)
{
- return std::pair<unsigned char, String>(listType, name);
+ ASSERT(type >= FirstNodeCollectionType);
+ return std::pair<unsigned char, String>(type - FirstNodeCollectionType, name);
}
NodeListAtomicNameCacheMap m_atomicNameCaches;
Modified: trunk/Source/WebCore/dom/PropertyNodeList.cpp (135475 => 135476)
--- trunk/Source/WebCore/dom/PropertyNodeList.cpp 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/dom/PropertyNodeList.cpp 2012-11-22 06:18:24 UTC (rev 135476)
@@ -51,7 +51,7 @@
PropertyNodeList::~PropertyNodeList()
{
- ownerNode()->nodeLists()->removeCacheWithName(this, DynamicNodeList::PropertyNodeListType, m_name);
+ ownerNode()->nodeLists()->removeCacheWithName(this, PropertyNodeListType, m_name);
}
bool PropertyNodeList::elementIsPropertyOfRefElement(const Node* testElement, const Node *refElement) const
Modified: trunk/Source/WebCore/dom/TagNodeList.cpp (135475 => 135476)
--- trunk/Source/WebCore/dom/TagNodeList.cpp 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/dom/TagNodeList.cpp 2012-11-22 06:18:24 UTC (rev 135476)
@@ -41,7 +41,7 @@
TagNodeList::~TagNodeList()
{
if (m_namespaceURI == starAtom)
- ownerNode()->nodeLists()->removeCacheWithAtomicName(this, DynamicNodeList::TagNodeListType, m_localName);
+ ownerNode()->nodeLists()->removeCacheWithAtomicName(this, TagNodeListType, m_localName);
else
ownerNode()->nodeLists()->removeCacheWithQualifiedName(this, m_namespaceURI, m_localName);
}
Modified: trunk/Source/WebCore/html/CollectionType.h (135475 => 135476)
--- trunk/Source/WebCore/html/CollectionType.h 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/html/CollectionType.h 2012-11-22 06:18:24 UTC (rev 135476)
@@ -60,14 +60,24 @@
#endif
FormControls,
- NodeListCollectionType
+
+ // Live node lists.
+
+ ChildNodeListType,
+ ClassNodeListType,
+ NameNodeListType,
+ TagNodeListType,
+ RadioNodeListType,
+ LabelsNodeListType,
+ MicroDataItemListType,
+ PropertyNodeListType,
};
static const CollectionType FirstUnnamedDocumentCachedType = DocImages;
static const unsigned NumUnnamedDocumentCachedTypes = WindowNamedItems - DocImages;
static const CollectionType FirstNodeCollectionType = NodeChildren;
-static const unsigned NumNodeCollectionTypes = FormControls - NodeChildren + 1;
+static const CollectionType FirstNodeListType = ChildNodeListType;
inline bool isUnnamedDocumentCachedType(CollectionType type)
{
@@ -79,6 +89,11 @@
return type >= FirstNodeCollectionType;
}
+inline bool isNodeList(CollectionType type)
+{
+ return type >= FirstNodeListType;
+}
+
} // namespace
#endif
Modified: trunk/Source/WebCore/html/HTMLCollection.cpp (135475 => 135476)
--- trunk/Source/WebCore/html/HTMLCollection.cpp 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/html/HTMLCollection.cpp 2012-11-22 06:18:24 UTC (rev 135476)
@@ -69,7 +69,14 @@
case TSectionRows:
case TableTBodies:
return true;
- case NodeListCollectionType:
+ case ChildNodeListType:
+ case ClassNodeListType:
+ case NameNodeListType:
+ case TagNodeListType:
+ case RadioNodeListType:
+ case LabelsNodeListType:
+ case MicroDataItemListType:
+ case PropertyNodeListType:
break;
}
ASSERT_NOT_REACHED();
@@ -103,8 +110,16 @@
case SelectedOptions:
case DataListOptions:
case MapAreas:
- case NodeListCollectionType:
return NodeListIsRootedAtNode;
+ case ChildNodeListType:
+ case ClassNodeListType:
+ case NameNodeListType:
+ case TagNodeListType:
+ case RadioNodeListType:
+ case LabelsNodeListType:
+ case MicroDataItemListType:
+ case PropertyNodeListType:
+ break;
}
ASSERT_NOT_REACHED();
return NodeListIsRootedAtNode;
@@ -145,7 +160,14 @@
#endif
case FormControls:
return InvalidateForFormControls;
- case NodeListCollectionType:
+ case ChildNodeListType:
+ case ClassNodeListType:
+ case NameNodeListType:
+ case TagNodeListType:
+ case RadioNodeListType:
+ case LabelsNodeListType:
+ case MicroDataItemListType:
+ case PropertyNodeListType:
break;
}
ASSERT_NOT_REACHED();
@@ -229,7 +251,14 @@
case DocumentNamedItems:
case TableRows:
case WindowNamedItems:
- case NodeListCollectionType:
+ case ChildNodeListType:
+ case ClassNodeListType:
+ case NameNodeListType:
+ case TagNodeListType:
+ case RadioNodeListType:
+ case LabelsNodeListType:
+ case MicroDataItemListType:
+ case PropertyNodeListType:
ASSERT_NOT_REACHED();
}
return false;
@@ -267,7 +296,7 @@
CollectionType collectionType = type();
Node* rootNode = this->rootNode();
for (; current; current = nextNode<forward>(rootNode, current, onlyIncludeDirectChildren)) {
- if (collectionType == NodeListCollectionType) {
+ if (isNodeList(collectionType)) {
if (current->isElementNode() && static_cast<const DynamicNodeList*>(this)->nodeMatches(toElement(current)))
return toElement(current);
} else {
@@ -289,7 +318,7 @@
else
current = firstNode(forward, rootNode(), shouldOnlyIncludeDirectChildren());
- if (type() == NodeListCollectionType && shouldOnlyIncludeDirectChildren()) // ChildNodeList
+ if (isNodeList(type()) && shouldOnlyIncludeDirectChildren()) // ChildNodeList
return current;
return iterateForNextNode<forward>(current);
@@ -367,7 +396,7 @@
#if ENABLE(MICRODATA)
if (type() == ItemProperties)
static_cast<const HTMLPropertiesCollection*>(this)->updateRefElements();
- if (type() == NodeListCollectionType && rootType() == NodeListIsRootedAtDocumentIfOwnerHasItemrefAttr)
+ else if (type() == PropertyNodeListType)
static_cast<const PropertyNodeList*>(this)->updateRefElements();
#endif
Modified: trunk/Source/WebCore/html/LabelableElement.cpp (135475 => 135476)
--- trunk/Source/WebCore/html/LabelableElement.cpp 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/html/LabelableElement.cpp 2012-11-22 06:18:24 UTC (rev 135476)
@@ -47,7 +47,7 @@
if (!document())
return 0;
- return ensureRareData()->ensureNodeLists()->addCacheWithAtomicName<LabelsNodeList>(this, DynamicNodeList::LabelsNodeListType, starAtom);
+ return ensureRareData()->ensureNodeLists()->addCacheWithAtomicName<LabelsNodeList>(this, LabelsNodeListType, starAtom);
}
} // namespace Webcore
Modified: trunk/Source/WebCore/html/LabelsNodeList.cpp (135475 => 135476)
--- trunk/Source/WebCore/html/LabelsNodeList.cpp 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/html/LabelsNodeList.cpp 2012-11-22 06:18:24 UTC (rev 135476)
@@ -40,7 +40,7 @@
LabelsNodeList::~LabelsNodeList()
{
- ownerNode()->nodeLists()->removeCacheWithAtomicName(this, DynamicNodeList::LabelsNodeListType, starAtom);
+ ownerNode()->nodeLists()->removeCacheWithAtomicName(this, LabelsNodeListType, starAtom);
}
bool LabelsNodeList::nodeMatches(Element* testNode) const
Modified: trunk/Source/WebCore/html/RadioNodeList.cpp (135475 => 135476)
--- trunk/Source/WebCore/html/RadioNodeList.cpp 2012-11-22 06:06:18 UTC (rev 135475)
+++ trunk/Source/WebCore/html/RadioNodeList.cpp 2012-11-22 06:18:24 UTC (rev 135476)
@@ -45,7 +45,7 @@
RadioNodeList::~RadioNodeList()
{
- ownerNode()->nodeLists()->removeCacheWithAtomicName(this, DynamicNodeList::RadioNodeListType, m_name);
+ ownerNode()->nodeLists()->removeCacheWithAtomicName(this, RadioNodeListType, m_name);
}
static inline HTMLInputElement* toRadioButtonInputElement(Node* node)