| Index: Source/core/editing/CompositeEditCommand.cpp
|
| diff --git a/Source/core/editing/CompositeEditCommand.cpp b/Source/core/editing/CompositeEditCommand.cpp
|
| index 3b3ade0f3d9f22b07bacd384ee5f65d2800a7543..da7144fa9eab9f02513daf35d943a37dd3c54b10 100644
|
| --- a/Source/core/editing/CompositeEditCommand.cpp
|
| +++ b/Source/core/editing/CompositeEditCommand.cpp
|
| @@ -959,8 +959,10 @@ void CompositeEditCommand::pushAnchorElementDown(Node* anchorNode)
|
| // Clone the paragraph between start and end under blockElement,
|
| // preserving the hierarchy up to outerNode.
|
|
|
| -void CompositeEditCommand::cloneParagraphUnderNewElement(Position& start, Position& end, Node* passedOuterNode, Element* blockElement)
|
| +void CompositeEditCommand::cloneParagraphUnderNewElement(const Position& start, const Position& end, Node* passedOuterNode, Element* blockElement)
|
| {
|
| + ASSERT(comparePositions(start, end) <= 0);
|
| +
|
| // First we clone the outerNode
|
| RefPtr<Node> lastNode;
|
| RefPtr<Node> outerNode = passedOuterNode;
|
| @@ -1090,7 +1092,7 @@ void CompositeEditCommand::moveParagraphWithClones(const VisiblePosition& startO
|
| // We upstream() the end and downstream() the start so that we don't include collapsed whitespace in the move.
|
| // When we paste a fragment, spaces after the end and before the start are treated as though they were rendered.
|
| Position start = startOfParagraphToMove.deepEquivalent().downstream();
|
| - Position end = endOfParagraphToMove.deepEquivalent().upstream();
|
| + Position end = startOfParagraphToMove == endOfParagraphToMove ? start : endOfParagraphToMove.deepEquivalent().upstream();
|
|
|
| cloneParagraphUnderNewElement(start, end, outerNode, blockElement);
|
|
|
|
|