summaryrefslogtreecommitdiffstats
path: root/WebCore/editing/ReplaceNodeWithSpanCommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/editing/ReplaceNodeWithSpanCommand.cpp')
-rw-r--r--WebCore/editing/ReplaceNodeWithSpanCommand.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/WebCore/editing/ReplaceNodeWithSpanCommand.cpp b/WebCore/editing/ReplaceNodeWithSpanCommand.cpp
index 21ca924..0874201 100644
--- a/WebCore/editing/ReplaceNodeWithSpanCommand.cpp
+++ b/WebCore/editing/ReplaceNodeWithSpanCommand.cpp
@@ -57,7 +57,9 @@ static void swapInNodePreservingAttributesAndChildren(Node* newNode, Node* nodeT
parentNode->insertBefore(newNode, nodeToReplace, ec);
ASSERT(!ec);
- for (Node* child = nodeToReplace->firstChild(); child; child = child->nextSibling()) {
+ Node* nextChild;
+ for (Node* child = nodeToReplace->firstChild(); child; child = nextChild) {
+ nextChild = child->nextSibling();
newNode->appendChild(child, ec);
ASSERT(!ec);
}