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

Unified Diff: Source/core/dom/LiveNodeList.h

Issue 154693002: Have ChildNodeList subclass NodeList instead of LiveNodeList (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update copyright 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
Index: Source/core/dom/LiveNodeList.h
diff --git a/Source/core/dom/LiveNodeList.h b/Source/core/dom/LiveNodeList.h
index 77d86956b4808411938a78d17865b454a936d492..2dc8518f8e4b774e35cf7d3e30f1e20e0df55f8e 100644
--- a/Source/core/dom/LiveNodeList.h
+++ b/Source/core/dom/LiveNodeList.h
@@ -57,14 +57,12 @@ public:
ASSERT(m_invalidationType == static_cast<unsigned>(invalidationType));
ASSERT(m_collectionType == static_cast<unsigned>(collectionType));
- if (collectionType != ChildNodeListType)
- document().registerNodeList(this);
+ document().registerNodeList(this);
}
virtual ~LiveNodeListBase()
{
- if (type() != ChildNodeListType)
- document().unregisterNodeList(this);
+ document().unregisterNodeList(this);
}
ContainerNode& rootNode() const;
@@ -94,7 +92,7 @@ protected:
template <typename Collection>
static Element* iterateForPreviousNode(const Collection&, Node* current);
template <typename Collection>
- static Element* itemBefore(const Collection&, const Node* previousItem);
+ static Element* itemBefore(const Collection&, const Element* previousItem);
private:
void invalidateIdNameCacheMaps() const;
@@ -134,7 +132,7 @@ ALWAYS_INLINE bool LiveNodeListBase::shouldInvalidateTypeOnAttributeChange(NodeL
class LiveNodeList : public NodeList, public LiveNodeListBase {
public:
LiveNodeList(PassRefPtr<ContainerNode> ownerNode, CollectionType collectionType, NodeListInvalidationType invalidationType, NodeListRootType rootType = NodeListIsRootedAtNode)
- : LiveNodeListBase(ownerNode.get(), rootType, invalidationType, collectionType == ChildNodeListType,
+ : LiveNodeListBase(ownerNode.get(), rootType, invalidationType, false,
collectionType)
{ }
@@ -148,14 +146,14 @@ public:
// Collection IndexCache API.
bool canTraverseBackward() const { return true; }
- Node* itemBefore(const Node* previousItem) const;
- Node* traverseToFirstElement(const ContainerNode& root) const;
- Node* traverseForwardToOffset(unsigned offset, Node& currentNode, unsigned& currentOffset, const ContainerNode& root) const;
+ Element* itemBefore(const Element* previousItem) const;
+ Element* traverseToFirstElement(const ContainerNode& root) const;
+ Element* traverseForwardToOffset(unsigned offset, Element& currentNode, unsigned& currentOffset, const ContainerNode& root) const;
private:
virtual bool isLiveNodeList() const OVERRIDE FINAL { return true; }
- mutable CollectionIndexCache<LiveNodeList, Node> m_collectionIndexCache;
+ mutable CollectionIndexCache<LiveNodeList, Element> m_collectionIndexCache;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698