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

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

Issue 229213002: Make HTMLCollection / NodeList backward traversal consistent with forward one (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/ChildNodeList.cpp » ('j') | Source/core/dom/ElementTraversal.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ChildNodeList.h
diff --git a/Source/core/dom/ChildNodeList.h b/Source/core/dom/ChildNodeList.h
index 517935893900396714ca3b5ad80badd518a49999..a7dd03d699f4e201dadade1d7577513d224fe2e1 100644
--- a/Source/core/dom/ChildNodeList.h
+++ b/Source/core/dom/ChildNodeList.h
@@ -48,12 +48,14 @@ public:
void invalidateCache() { m_collectionIndexCache.invalidate(); }
ContainerNode& ownerNode() const { return *m_parent; }
- // CollectionIndexCache API.
ContainerNode& rootNode() const { return ownerNode(); }
+
+ // CollectionIndexCache API.
bool canTraverseBackward() const { return true; }
- Node* itemBefore(const Node* previousItem) const;
Node* traverseToFirstElement() const { return rootNode().firstChild(); }
+ Node* traverseToLastElement() const { return rootNode().lastChild(); }
Node* traverseForwardToOffset(unsigned offset, Node& currentNode, unsigned& currentOffset) const;
+ Node* traverseBackwardToOffset(unsigned offset, Node& currentNode, unsigned& currentOffset) const;
private:
explicit ChildNodeList(ContainerNode& rootNode);
« no previous file with comments | « no previous file | Source/core/dom/ChildNodeList.cpp » ('j') | Source/core/dom/ElementTraversal.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698