Index: Source/WebCore/editing/CompositeEditCommand.cpp |
=================================================================== |
--- Source/WebCore/editing/CompositeEditCommand.cpp (revision 109471) |
+++ Source/WebCore/editing/CompositeEditCommand.cpp (working copy) |
@@ -528,6 +528,8 @@ |
if (!textNode || start >= end) |
return; |
+ document()->updateLayout(); |
+ |
RenderText* textRenderer = toRenderText(textNode->renderer()); |
if (!textRenderer) |
return; |
@@ -610,18 +612,20 @@ |
if (comparePositions(start, end) >= 0) |
return; |
- Node* next; |
- for (Node* node = start.deprecatedNode(); node; node = next) { |
- next = node->traverseNextNode(); |
- if (node->isTextNode()) { |
- Text* textNode = static_cast<Text*>(node); |
- int startOffset = node == start.deprecatedNode() ? start.deprecatedEditingOffset() : 0; |
- int endOffset = node == end.deprecatedNode() ? end.deprecatedEditingOffset() : static_cast<int>(textNode->length()); |
- deleteInsignificantText(textNode, startOffset, endOffset); |
- } |
+ Vector<RefPtr<Text> > nodes; |
+ for (Node* node = start.deprecatedNode(); node; node = node->traverseNextNode()) { |
+ if (node->isTextNode()) |
+ nodes.append(static_cast<Text*>(node)); |
if (node == end.deprecatedNode()) |
break; |
} |
+ |
+ for (size_t i = 0; i < nodes.size(); ++i) { |
+ Text* textNode = nodes[i].get(); |
+ int startOffset = textNode == start.deprecatedNode() ? start.deprecatedEditingOffset() : 0; |
+ int endOffset = textNode == end.deprecatedNode() ? end.deprecatedEditingOffset() : static_cast<int>(textNode->length()); |
+ deleteInsignificantText(textNode, startOffset, endOffset); |
+ } |
} |
void CompositeEditCommand::deleteInsignificantTextDownstream(const Position& pos) |