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

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

Issue 69003004: Have NodeTraversal::previous*() take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 | « no previous file | Source/core/dom/NodeIterator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ElementTraversal.h
diff --git a/Source/core/dom/ElementTraversal.h b/Source/core/dom/ElementTraversal.h
index 0e85492cf15ef62cefc0a11e6cab7d87224f3894..5550babbbdbd07df477a71550e9b4d386009cbee 100644
--- a/Source/core/dom/ElementTraversal.h
+++ b/Source/core/dom/ElementTraversal.h
@@ -49,12 +49,12 @@ Element* nextSkippingChildren(const ContainerNode*);
Element* nextSkippingChildren(const ContainerNode*, const Node* stayWithin);
// Pre-order traversal including the pseudo-elements.
-Element* previousIncludingPseudo(const Node*, const Node* stayWithin = 0);
+Element* previousIncludingPseudo(const Node&, const Node* stayWithin = 0);
Element* nextIncludingPseudo(const Node*, const Node* stayWithin = 0);
Element* nextIncludingPseudoSkippingChildren(const Node*, const Node* stayWithin = 0);
// Utility function to traverse only the element and pseudo-element siblings of a node.
-Element* pseudoAwarePreviousSibling(const Node*);
+Element* pseudoAwarePreviousSibling(const Node&);
template <class NodeType>
inline Element* firstElementWithinTemplate(NodeType* current)
@@ -112,11 +112,11 @@ inline Element* traverseNextElementSkippingChildrenTemplate(NodeType* current, c
inline Element* nextSkippingChildren(const ContainerNode* current, const Node* stayWithin) { return traverseNextElementSkippingChildrenTemplate(current, stayWithin); }
inline Element* nextSkippingChildren(const Node* current, const Node* stayWithin) { return traverseNextElementSkippingChildrenTemplate(current, stayWithin); }
-inline Element* previousIncludingPseudo(const Node* current, const Node* stayWithin)
+inline Element* previousIncludingPseudo(const Node& current, const Node* stayWithin)
{
Node* node = NodeTraversal::previousIncludingPseudo(current, stayWithin);
while (node && !node->isElementNode())
- node = NodeTraversal::previousIncludingPseudo(node, stayWithin);
+ node = NodeTraversal::previousIncludingPseudo(*node, stayWithin);
return toElement(node);
}
@@ -136,9 +136,9 @@ inline Element* nextIncludingPseudoSkippingChildren(const Node* current, const N
return toElement(node);
}
-inline Element* pseudoAwarePreviousSibling(const Node* current)
+inline Element* pseudoAwarePreviousSibling(const Node& current)
{
- Node* node = current->pseudoAwarePreviousSibling();
+ Node* node = current.pseudoAwarePreviousSibling();
while (node && !node->isElementNode())
node = node->pseudoAwarePreviousSibling();
return toElement(node);
« no previous file with comments | « no previous file | Source/core/dom/NodeIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698