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); |
+} |
+ |
} |
} |