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

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

Issue 152903002: Move m_overridesItemAfter member from LiveNodeListBase to HTMLCollection (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: No change 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
« no previous file with comments | « no previous file | Source/core/html/CollectionIndexCache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/LiveNodeList.h
diff --git a/Source/core/dom/LiveNodeList.h b/Source/core/dom/LiveNodeList.h
index e7026bf381edd4d6e5496023b1c191e2b7c3b121..4dc568b05443a776aa82418012ea0616b58e5ae7 100644
--- a/Source/core/dom/LiveNodeList.h
+++ b/Source/core/dom/LiveNodeList.h
@@ -44,25 +44,18 @@ enum NodeListRootType {
class LiveNodeListBase {
public:
- enum ItemAfterOverrideType {
- OverridesItemAfter,
- DoesNotOverrideItemAfter,
- };
-
LiveNodeListBase(ContainerNode* ownerNode, NodeListRootType rootType, NodeListInvalidationType invalidationType,
- bool shouldOnlyIncludeDirectChildren, CollectionType collectionType, ItemAfterOverrideType itemAfterOverrideType)
+ bool shouldOnlyIncludeDirectChildren, CollectionType collectionType)
: m_ownerNode(ownerNode)
, m_rootType(rootType)
, m_invalidationType(invalidationType)
, m_shouldOnlyIncludeDirectChildren(shouldOnlyIncludeDirectChildren)
, m_collectionType(collectionType)
- , m_overridesItemAfter(itemAfterOverrideType == OverridesItemAfter)
{
ASSERT(m_ownerNode);
ASSERT(m_rootType == static_cast<unsigned>(rootType));
ASSERT(m_invalidationType == static_cast<unsigned>(invalidationType));
ASSERT(m_collectionType == static_cast<unsigned>(collectionType));
- ASSERT(!m_overridesItemAfter || !isLiveNodeListType(collectionType));
if (collectionType != ChildNodeListType)
document().registerNodeList(this);
@@ -75,7 +68,6 @@ public:
}
ContainerNode& rootNode() const;
- bool overridesItemAfter() const { return m_overridesItemAfter; }
Node* itemBefore(const Node* previousItem) const;
ALWAYS_INLINE bool hasIdNameCache() const { return !isLiveNodeListType(type()); }
@@ -109,9 +101,6 @@ private:
const unsigned m_invalidationType : 4;
const unsigned m_shouldOnlyIncludeDirectChildren : 1;
const unsigned m_collectionType : 5;
-
- // From HTMLCollection
- const unsigned m_overridesItemAfter : 1;
};
ALWAYS_INLINE bool LiveNodeListBase::shouldInvalidateTypeOnAttributeChange(NodeListInvalidationType type, const QualifiedName& attrName)
@@ -143,7 +132,7 @@ 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,
- collectionType, DoesNotOverrideItemAfter)
+ collectionType)
{ }
virtual unsigned length() const OVERRIDE FINAL { return m_collectionIndexCache.nodeCount(*this); }
@@ -156,6 +145,7 @@ public:
virtual void invalidateCache() const OVERRIDE FINAL;
// Collection IndexCache API.
+ bool canTraverseBackward() const { return true; }
Node* traverseToFirstElement(const ContainerNode& root) const;
Node* traverseForwardToOffset(unsigned offset, Node& currentNode, unsigned& currentOffset, const ContainerNode& root) const;
« no previous file with comments | « no previous file | Source/core/html/CollectionIndexCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698