Chromium Code Reviews| 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) |
|
adamk
2014/02/13 21:42:58
This is an exact duplicate of Node::nextElementSib
Inactive
2014/02/13 21:51:37
Yes and ElementTraversal::firstWithin() is identic
|
| +{ |
| + Node* node = current.nextSibling(); |
| + while (node && !node->isElementNode()) |
| + node = node->nextSibling(); |
| + return toElement(node); |
| +} |
| + |
| } |
| } |