| Index: Source/core/editing/CompositeEditCommand.cpp
|
| diff --git a/Source/core/editing/CompositeEditCommand.cpp b/Source/core/editing/CompositeEditCommand.cpp
|
| index 69c7748e65f2f8ac8d192db9a258e9078de4fdb5..5b5047996820dda81e90247e2c88a85d682dcc96 100644
|
| --- a/Source/core/editing/CompositeEditCommand.cpp
|
| +++ b/Source/core/editing/CompositeEditCommand.cpp
|
| @@ -950,6 +950,11 @@ PassRefPtrWillBeRawPtr<Node> CompositeEditCommand::moveParagraphContentsToNewBlo
|
|
|
| bool endWasBr = isHTMLBRElement(*visibleParagraphEnd.deepEquivalent().deprecatedNode());
|
|
|
| + // Inserting default paragraph element can change visible position. We
|
| + // should update visible positions before use them.
|
| + visiblePos = VisiblePosition(pos, VP_DEFAULT_AFFINITY);
|
| + visibleParagraphStart = VisiblePosition(startOfParagraph(visiblePos));
|
| + visibleParagraphEnd = VisiblePosition(endOfParagraph(visiblePos));
|
| moveParagraphs(visibleParagraphStart, visibleParagraphEnd, VisiblePosition(firstPositionInNode(newBlock.get())));
|
|
|
| if (newBlock->lastChild() && isHTMLBRElement(*newBlock->lastChild()) && !endWasBr)
|
|
|