summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/editing/ReplaceNodeWithSpanCommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/editing/ReplaceNodeWithSpanCommand.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/editing/ReplaceNodeWithSpanCommand.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/3rdparty/webkit/WebCore/editing/ReplaceNodeWithSpanCommand.cpp b/src/3rdparty/webkit/WebCore/editing/ReplaceNodeWithSpanCommand.cpp
index 21ca924..0874201 100644
--- a/src/3rdparty/webkit/WebCore/editing/ReplaceNodeWithSpanCommand.cpp
+++ b/src/3rdparty/webkit/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);
}