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

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

Issue 68523014: Update remaining NodeTraversal / ElementTraversal methods to take references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix build Created 7 years, 1 month 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/NodeTraversal.h ('k') | Source/core/dom/Text.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/NodeTraversal.cpp
diff --git a/Source/core/dom/NodeTraversal.cpp b/Source/core/dom/NodeTraversal.cpp
index 1ec16961d852b29263ce18f6fb46e3d64359fc48..631a8b9c741b27c4473e41036afa58f1a4d37429 100644
--- a/Source/core/dom/NodeTraversal.cpp
+++ b/Source/core/dom/NodeTraversal.cpp
@@ -42,33 +42,33 @@ Node* previousIncludingPseudo(const Node& current, const Node* stayWithin)
return current.parentNode();
}
-Node* nextIncludingPseudo(const Node* current, const Node* stayWithin)
+Node* nextIncludingPseudo(const Node& current, const Node* stayWithin)
{
- if (Node* next = current->pseudoAwareFirstChild())
+ if (Node* next = current.pseudoAwareFirstChild())
return next;
if (current == stayWithin)
return 0;
- if (Node* next = current->pseudoAwareNextSibling())
+ if (Node* next = current.pseudoAwareNextSibling())
return next;
- for (current = current->parentNode(); current; current = current->parentNode()) {
- if (current == stayWithin)
+ for (Node* parent = current.parentNode(); parent; parent = parent->parentNode()) {
+ if (parent == stayWithin)
return 0;
- if (Node* next = current->pseudoAwareNextSibling())
+ if (Node* next = parent->pseudoAwareNextSibling())
return next;
}
return 0;
}
-Node* nextIncludingPseudoSkippingChildren(const Node* current, const Node* stayWithin)
+Node* nextIncludingPseudoSkippingChildren(const Node& current, const Node* stayWithin)
{
if (current == stayWithin)
return 0;
- if (Node* next = current->pseudoAwareNextSibling())
+ if (Node* next = current.pseudoAwareNextSibling())
return next;
- for (current = current->parentNode(); current; current = current->parentNode()) {
- if (current == stayWithin)
+ for (Node* parent = current.parentNode(); parent; parent = parent->parentNode()) {
+ if (parent == stayWithin)
return 0;
- if (Node* next = current->pseudoAwareNextSibling())
+ if (Node* next = parent->pseudoAwareNextSibling())
return next;
}
return 0;
@@ -125,13 +125,13 @@ Node* previousSkippingChildren(const Node& current, const Node* stayWithin)
return 0;
}
-Node* nextPostOrder(const Node* current, const Node* stayWithin)
+Node* nextPostOrder(const Node& current, const Node* stayWithin)
{
if (current == stayWithin)
return 0;
- if (!current->nextSibling())
- return current->parentNode();
- Node* next = current->nextSibling();
+ if (!current.nextSibling())
+ return current.parentNode();
+ Node* next = current.nextSibling();
while (next->firstChild())
next = next->firstChild();
return next;
« no previous file with comments | « Source/core/dom/NodeTraversal.h ('k') | Source/core/dom/Text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698