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

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

Issue 69543007: Have NodeTraversal::nextSkippingChildren() take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master 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/css/StyleInvalidationAnalysis.cpp ('k') | Source/core/dom/NodeTraversal.h » ('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 5550babbbdbd07df477a71550e9b4d386009cbee..8e1db0e1c29a187fa843ebf656f89656db5831eb 100644
--- a/Source/core/dom/ElementTraversal.h
+++ b/Source/core/dom/ElementTraversal.h
@@ -43,10 +43,10 @@ Element* next(const ContainerNode&);
Element* next(const ContainerNode&, const Node* stayWithin);
// Like next, but skips children.
-Element* nextSkippingChildren(const Node*);
-Element* nextSkippingChildren(const Node*, const Node* stayWithin);
-Element* nextSkippingChildren(const ContainerNode*);
-Element* nextSkippingChildren(const ContainerNode*, const Node* stayWithin);
+Element* nextSkippingChildren(const Node&);
+Element* nextSkippingChildren(const Node&, const Node* stayWithin);
+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);
@@ -73,7 +73,7 @@ inline Element* traverseNextElementTemplate(NodeType& current)
{
Node* node = NodeTraversal::next(current);
while (node && !node->isElementNode())
- node = NodeTraversal::nextSkippingChildren(node);
+ node = NodeTraversal::nextSkippingChildren(*node);
return toElement(node);
}
inline Element* next(const ContainerNode& current) { return traverseNextElementTemplate(current); }
@@ -84,33 +84,33 @@ inline Element* traverseNextElementTemplate(NodeType& current, const Node* stayW
{
Node* node = NodeTraversal::next(current, stayWithin);
while (node && !node->isElementNode())
- node = NodeTraversal::nextSkippingChildren(node, stayWithin);
+ node = NodeTraversal::nextSkippingChildren(*node, stayWithin);
return toElement(node);
}
inline Element* next(const ContainerNode& current, const Node* stayWithin) { return traverseNextElementTemplate(current, stayWithin); }
inline Element* next(const Node& current, const Node* stayWithin) { return traverseNextElementTemplate(current, stayWithin); }
template <class NodeType>
-inline Element* traverseNextElementSkippingChildrenTemplate(NodeType* current)
+inline Element* traverseNextElementSkippingChildrenTemplate(NodeType& current)
{
Node* node = NodeTraversal::nextSkippingChildren(current);
while (node && !node->isElementNode())
- node = NodeTraversal::nextSkippingChildren(node);
+ node = NodeTraversal::nextSkippingChildren(*node);
return toElement(node);
}
-inline Element* nextSkippingChildren(const ContainerNode* current) { return traverseNextElementSkippingChildrenTemplate(current); }
-inline Element* nextSkippingChildren(const Node* current) { return traverseNextElementSkippingChildrenTemplate(current); }
+inline Element* nextSkippingChildren(const ContainerNode& current) { return traverseNextElementSkippingChildrenTemplate(current); }
+inline Element* nextSkippingChildren(const Node& current) { return traverseNextElementSkippingChildrenTemplate(current); }
template <class NodeType>
-inline Element* traverseNextElementSkippingChildrenTemplate(NodeType* current, const Node* stayWithin)
+inline Element* traverseNextElementSkippingChildrenTemplate(NodeType& current, const Node* stayWithin)
{
Node* node = NodeTraversal::nextSkippingChildren(current, stayWithin);
while (node && !node->isElementNode())
- node = NodeTraversal::nextSkippingChildren(node, stayWithin);
+ node = NodeTraversal::nextSkippingChildren(*node, stayWithin);
return toElement(node);
}
-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* 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)
{
« no previous file with comments | « Source/core/css/StyleInvalidationAnalysis.cpp ('k') | Source/core/dom/NodeTraversal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698