| Index: third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
|
| index eedb7d56842d1e910fc531a802d8bc6af80c11c4..8e059e8cb12c18a3f9389b14e281be8c5805d5ac 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
|
| @@ -1380,6 +1380,9 @@ void ReplaceSelectionCommand::completeHTMLReplacement(const Position &lastPositi
|
| return;
|
| }
|
|
|
| + m_startOfInsertedRange = start;
|
| + m_endOfInsertedRange = end;
|
| +
|
| if (m_selectReplacement)
|
| setEndingSelection(VisibleSelection(start, end, SEL_DEFAULT_AFFINITY, endingSelection().isDirectional()));
|
| else
|
| @@ -1532,6 +1535,9 @@ bool ReplaceSelectionCommand::performTrivialReplace(const ReplacementFragment& f
|
| && shouldRemoveEndBR(toHTMLBRElement(nodeAfterInsertionPos.get()), createVisiblePosition(positionBeforeNode(nodeAfterInsertionPos.get()))))
|
| removeNodeAndPruneAncestors(nodeAfterInsertionPos.get());
|
|
|
| + m_startOfInsertedRange = start;
|
| + m_endOfInsertedRange = end;
|
| +
|
| VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, end);
|
|
|
| setEndingSelection(selectionAfterReplace);
|
| @@ -1550,6 +1556,8 @@ DEFINE_TRACE(ReplaceSelectionCommand)
|
| visitor->trace(m_endOfInsertedContent);
|
| visitor->trace(m_insertionStyle);
|
| visitor->trace(m_documentFragment);
|
| + visitor->trace(m_startOfInsertedRange);
|
| + visitor->trace(m_endOfInsertedRange);
|
| CompositeEditCommand::trace(visitor);
|
| }
|
|
|
|
|