Index: Source/core/dom/NodeTraversal.cpp |
diff --git a/Source/core/dom/NodeTraversal.cpp b/Source/core/dom/NodeTraversal.cpp |
index 11a9661374ce56e2507effbd7d3278e439d948e0..e07b695893546b0c567a5a79edb4bb4af5fc34df 100644 |
--- a/Source/core/dom/NodeTraversal.cpp |
+++ b/Source/core/dom/NodeTraversal.cpp |
@@ -30,16 +30,16 @@ |
namespace WebCore { |
namespace NodeTraversal { |
-Node* previousIncludingPseudo(const Node* current, const Node* stayWithin) |
+Node* previousIncludingPseudo(const Node& current, const Node* stayWithin) |
{ |
if (current == stayWithin) |
return 0; |
- if (Node* previous = current->pseudoAwarePreviousSibling()) { |
+ if (Node* previous = current.pseudoAwarePreviousSibling()) { |
while (previous->pseudoAwareLastChild()) |
previous = previous->pseudoAwareLastChild(); |
return previous; |
} |
- return current->parentNode(); |
+ return current.parentNode(); |
} |
Node* nextIncludingPseudo(const Node* current, const Node* stayWithin) |
@@ -97,30 +97,30 @@ Node* nextAncestorSibling(const Node* current, const Node* stayWithin) |
return 0; |
} |
-Node* previous(const Node* current, const Node* stayWithin) |
+Node* previous(const Node& current, const Node* stayWithin) |
{ |
if (current == stayWithin) |
return 0; |
- if (current->previousSibling()) { |
- Node* previous = current->previousSibling(); |
+ if (current.previousSibling()) { |
+ Node* previous = current.previousSibling(); |
while (previous->lastChild()) |
previous = previous->lastChild(); |
return previous; |
} |
- return current->parentNode(); |
+ return current.parentNode(); |
} |
-Node* previousSkippingChildren(const Node* current, const Node* stayWithin) |
+Node* previousSkippingChildren(const Node& current, const Node* stayWithin) |
{ |
if (current == stayWithin) |
return 0; |
- if (current->previousSibling()) |
- return current->previousSibling(); |
- for (current = current->parentNode(); current; current = current->parentNode()) { |
- if (current == stayWithin) |
+ if (current.previousSibling()) |
+ return current.previousSibling(); |
+ for (Node* parent = current.parentNode(); parent; parent = parent->parentNode()) { |
+ if (parent == stayWithin) |
return 0; |
- if (current->previousSibling()) |
- return current->previousSibling(); |
+ if (parent->previousSibling()) |
+ return parent->previousSibling(); |
} |
return 0; |
} |
@@ -137,35 +137,35 @@ Node* nextPostOrder(const Node* current, const Node* stayWithin) |
return next; |
} |
-static Node* previousAncestorSiblingPostOrder(const Node* current, const Node* stayWithin) |
+static Node* previousAncestorSiblingPostOrder(const Node& current, const Node* stayWithin) |
{ |
- ASSERT(!current->previousSibling()); |
- for (current = current->parentNode(); current; current = current->parentNode()) { |
- if (current == stayWithin) |
+ ASSERT(!current.previousSibling()); |
+ for (Node* parent = current.parentNode(); parent; parent = parent->parentNode()) { |
+ if (parent == stayWithin) |
return 0; |
- if (current->previousSibling()) |
- return current->previousSibling(); |
+ if (parent->previousSibling()) |
+ return parent->previousSibling(); |
} |
return 0; |
} |
-Node* previousPostOrder(const Node* current, const Node* stayWithin) |
+Node* previousPostOrder(const Node& current, const Node* stayWithin) |
{ |
- if (current->lastChild()) |
- return current->lastChild(); |
+ if (current.lastChild()) |
+ return current.lastChild(); |
if (current == stayWithin) |
return 0; |
- if (current->previousSibling()) |
- return current->previousSibling(); |
+ if (current.previousSibling()) |
+ return current.previousSibling(); |
return previousAncestorSiblingPostOrder(current, stayWithin); |
} |
-Node* previousSkippingChildrenPostOrder(const Node* current, const Node* stayWithin) |
+Node* previousSkippingChildrenPostOrder(const Node& current, const Node* stayWithin) |
{ |
if (current == stayWithin) |
return 0; |
- if (current->previousSibling()) |
- return current->previousSibling(); |
+ if (current.previousSibling()) |
+ return current.previousSibling(); |
return previousAncestorSiblingPostOrder(current, stayWithin); |
} |