Index: Source/core/html/HTMLTextFormControlElement.cpp |
diff --git a/Source/core/html/HTMLTextFormControlElement.cpp b/Source/core/html/HTMLTextFormControlElement.cpp |
index 4ba5d7d6cf0e194a61eeb5f1591b0226700f4be7..ddadae6c4d23ed3b9e59be24e358d3ea079ed76e 100644 |
--- a/Source/core/html/HTMLTextFormControlElement.cpp |
+++ b/Source/core/html/HTMLTextFormControlElement.cpp |
@@ -293,22 +293,22 @@ static Position positionForIndex(HTMLElement* innerEditor, int index) |
} |
int remainingCharactersToMoveForward = index; |
Node* lastBrOrText = innerEditor; |
- for (Node* node = NodeTraversal::next(*innerEditor, innerEditor); node; node = NodeTraversal::next(*node, innerEditor)) { |
+ for (Node& node : NodeTraversal::descendantsOf(*innerEditor)) { |
ASSERT(remainingCharactersToMoveForward >= 0); |
- if (node->hasTagName(brTag)) { |
+ if (node.hasTagName(brTag)) { |
if (remainingCharactersToMoveForward == 0) |
- return positionBeforeNode(node); |
+ return positionBeforeNode(&node); |
--remainingCharactersToMoveForward; |
- lastBrOrText = node; |
+ lastBrOrText = &node; |
continue; |
} |
- if (node->isTextNode()) { |
- Text& text = toText(*node); |
+ if (node.isTextNode()) { |
+ Text& text = toText(node); |
if (remainingCharactersToMoveForward < static_cast<int>(text.length())) |
return Position(&text, remainingCharactersToMoveForward); |
remainingCharactersToMoveForward -= text.length(); |
- lastBrOrText = node; |
+ lastBrOrText = &node; |
continue; |
} |