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

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

Issue 177213010: Move LiveNodeListBase class to its own header (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « Source/core/dom/LiveNodeList.cpp ('k') | Source/core/dom/LiveNodeListBase.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/LiveNodeListBase.h
diff --git a/Source/core/dom/LiveNodeList.h b/Source/core/dom/LiveNodeListBase.h
similarity index 76%
copy from Source/core/dom/LiveNodeList.h
copy to Source/core/dom/LiveNodeListBase.h
index 422e6bcc1da1606f86debac787270b7669315c3c..098d8ddfcce190a3990ec3465e337ff0c38c3ca4 100644
--- a/Source/core/dom/LiveNodeList.h
+++ b/Source/core/dom/LiveNodeListBase.h
@@ -3,6 +3,7 @@
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2001 Dirk Mueller (mueller@kde.org)
* Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 Samsung Electronics. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -21,21 +22,15 @@
*
*/
-#ifndef LiveNodeList_h
-#define LiveNodeList_h
+#ifndef LiveNodeListBase_h
+#define LiveNodeListBase_h
#include "HTMLNames.h"
#include "core/dom/Document.h"
-#include "core/dom/NodeList.h"
-#include "core/html/CollectionIndexCache.h"
#include "core/html/CollectionType.h"
-#include "wtf/Forward.h"
-#include "wtf/RefPtr.h"
namespace WebCore {
-class Element;
-
enum NodeListRootType {
NodeListIsRootedAtNode,
NodeListIsRootedAtDocument,
@@ -126,32 +121,6 @@ ALWAYS_INLINE bool LiveNodeListBase::shouldInvalidateTypeOnAttributeChange(NodeL
return false;
}
-class LiveNodeList : public NodeList, public LiveNodeListBase {
-public:
- LiveNodeList(PassRefPtr<ContainerNode> ownerNode, CollectionType collectionType, NodeListInvalidationType invalidationType, NodeListRootType rootType = NodeListIsRootedAtNode)
- : LiveNodeListBase(ownerNode.get(), rootType, invalidationType,
- collectionType)
- { }
-
- virtual unsigned length() const OVERRIDE FINAL { return m_collectionIndexCache.nodeCount(*this); }
- virtual Node* item(unsigned offset) const OVERRIDE FINAL { return m_collectionIndexCache.nodeAt(*this, offset); }
- virtual bool nodeMatches(const Element&) const = 0;
-
- virtual void invalidateCache(Document* oldDocument) const OVERRIDE FINAL;
- bool shouldOnlyIncludeDirectChildren() const { return false; }
-
- // Collection IndexCache API.
- bool canTraverseBackward() const { return true; }
- 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 Node* virtualOwnerNode() const OVERRIDE FINAL;
-
- mutable CollectionIndexCache<LiveNodeList, Element> m_collectionIndexCache;
-};
-
} // namespace WebCore
-#endif // LiveNodeList_h
+#endif // LiveNodeListBase_h
« no previous file with comments | « Source/core/dom/LiveNodeList.cpp ('k') | Source/core/dom/LiveNodeListBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698