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

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

Issue 163573004: Use ElementTraversal in HTMLTableRowsCollection::rowAfter() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tiny initialization fix Created 6 years, 10 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
« no previous file with comments | « no previous file | Source/core/html/HTMLTableRowsCollection.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 274725d57eeb8d0e535fa17ccb0b46e20d2aa798..4235e80d45b0ab0f15809a3a2ba5a98f57dc1c13 100644
--- a/Source/core/dom/ElementTraversal.h
+++ b/Source/core/dom/ElementTraversal.h
@@ -56,6 +56,9 @@ Element* nextIncludingPseudoSkippingChildren(const Node&, const Node* stayWithin
// Utility function to traverse only the element and pseudo-element siblings of a node.
Element* pseudoAwarePreviousSibling(const Node&);
+// Next sibling.
+Element* nextSibling(const Node&);
+
template <class NodeType>
inline Element* firstElementWithinTemplate(NodeType& current)
{
@@ -144,6 +147,14 @@ inline Element* pseudoAwarePreviousSibling(const Node& current)
return toElement(node);
}
+inline Element* nextSibling(const Node& current)
+{
+ Node* node = current.nextSibling();
+ while (node && !node->isElementNode())
+ node = node->nextSibling();
+ return toElement(node);
+}
+
}
}
« no previous file with comments | « no previous file | Source/core/html/HTMLTableRowsCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698