Index: Source/WebCore/editing/CompositeEditCommand.cpp |
=================================================================== |
--- Source/WebCore/editing/CompositeEditCommand.cpp (revision 79908) |
+++ Source/WebCore/editing/CompositeEditCommand.cpp (working copy) |
@@ -1098,8 +1098,8 @@ |
// If this is an empty paragraph there must be a line break here. |
if (!lineBreakExistsAtVisiblePosition(caret)) |
return false; |
- |
- Position caretPos(caret.deepEquivalent()); |
+ |
+ Position caretPos(caret.deepEquivalent().downstream()); |
// A line break is either a br or a preserved newline. |
ASSERT(caretPos.node()->hasTagName(brTag) || (caretPos.node()->isTextNode() && caretPos.node()->renderer()->style()->preserveNewline())); |
@@ -1107,7 +1107,7 @@ |
Position beforeBR(positionInParentBeforeNode(caretPos.node())); |
removeNode(caretPos.node()); |
prune(beforeBR.node()); |
- } else { |
+ } else if (caretPos.deprecatedNode()->isTextNode()) { |
ASSERT(caretPos.deprecatedEditingOffset() == 0); |
Text* textNode = static_cast<Text*>(caretPos.node()); |
ContainerNode* parentNode = textNode->parentNode(); |
@@ -1116,7 +1116,7 @@ |
deleteTextFromNode(textNode, 0, 1); |
prune(parentNode); |
} |
- |
+ |
return true; |
} |