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

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

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
Index: Source/core/dom/NodeTraversal.cpp
diff --git a/Source/core/dom/NodeTraversal.cpp b/Source/core/dom/NodeTraversal.cpp
index 37e37cc38814a9f3a022d2deefab6ff67a56f757..0f4a9f16a088c5522ada0984c9f3606287d37b00 100644
--- a/Source/core/dom/NodeTraversal.cpp
+++ b/Source/core/dom/NodeTraversal.cpp
@@ -96,6 +96,14 @@ Node* NodeTraversal::nextAncestorSibling(const Node& current, const Node* stayWi
return 0;
}
+Node* NodeTraversal::lastWithin(const ContainerNode& current)
+{
+ Node* descendant = current.lastChild();
+ for (Node* child = descendant; child; child = child->lastChild())
+ descendant = child;
+ return descendant;
+}
+
Node* NodeTraversal::previous(const Node& current, const Node* stayWithin)
{
if (current == stayWithin)

Powered by Google App Engine
This is Rietveld 408576698