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

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

Issue 181103005: Move LiveNodeList code out of HTMLCollection.cpp (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 | « no previous file | Source/core/dom/LiveNodeListBase.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/LiveNodeList.cpp
diff --git a/Source/core/dom/LiveNodeList.cpp b/Source/core/dom/LiveNodeList.cpp
index f1aff4d9d5fecef6a3fd8753cb8297b99bef1e2b..8f7c6cc28924137ff7f80322c991d1f0eee3c798 100644
--- a/Source/core/dom/LiveNodeList.cpp
+++ b/Source/core/dom/LiveNodeList.cpp
@@ -25,6 +25,11 @@
namespace WebCore {
+static inline bool isMatchingElement(const LiveNodeList& nodeList, const Element& element)
+{
+ return nodeList.nodeMatches(element);
+}
+
Node* LiveNodeList::virtualOwnerNode() const
{
return &ownerNode();
@@ -35,4 +40,19 @@ void LiveNodeList::invalidateCache(Document*) const
m_collectionIndexCache.invalidate();
}
+Element* LiveNodeList::itemBefore(const Element* previous) const
+{
+ return LiveNodeListBase::itemBefore(*this, previous);
+}
+
+Element* LiveNodeList::traverseToFirstElement(const ContainerNode& root) const
+{
+ return firstMatchingElement(*this, root);
+}
+
+Element* LiveNodeList::traverseForwardToOffset(unsigned offset, Element& currentNode, unsigned& currentOffset, const ContainerNode& root) const
+{
+ return traverseMatchingElementsForwardToOffset(*this, offset, currentNode, currentOffset, root);
+}
+
} // namespace WebCore
« no previous file with comments | « no previous file | Source/core/dom/LiveNodeListBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698