Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp |
| index e47b8b27d0ba607435d0a760bdd461d957cb98f9..bd52e0e45406a6c3cb8bfd25e9368a2b668819aa 100644 |
| --- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp |
| +++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp |
| @@ -255,9 +255,8 @@ void TypingCommand::insertText(Document& document, |
| document.frame()->spellChecker().updateMarkersForWordsAffectedByEditing( |
| isSpaceOrNewline(text[0])); |
| - insertText(document, text, |
| - frame->selection().computeVisibleSelectionInDOMTreeDeprecated(), |
| - options, composition, isIncrementalInsertion); |
| + insertText(document, text, frame->selection().selectionInDOMTree(), options, |
| + composition, isIncrementalInsertion); |
| } |
| void TypingCommand::adjustSelectionAfterIncrementalInsertion( |
| @@ -293,17 +292,20 @@ void TypingCommand::adjustSelectionAfterIncrementalInsertion( |
| // FIXME: We shouldn't need to take selectionForInsertion. It should be |
|
Xiaocheng
2017/03/07 18:56:01
nit: s/selectionForInsertion/passedSelectionForIns
|
| // identical to FrameSelection's current selection. |
| -void TypingCommand::insertText(Document& document, |
| - const String& text, |
| - const VisibleSelection& selectionForInsertion, |
| - Options options, |
| - TextCompositionType compositionType, |
| - const bool isIncrementalInsertion) { |
| +void TypingCommand::insertText( |
| + Document& document, |
| + const String& text, |
| + const SelectionInDOMTree& passedSelectionForInsertion, |
| + Options options, |
| + TextCompositionType compositionType, |
| + const bool isIncrementalInsertion) { |
| LocalFrame* frame = document.frame(); |
| DCHECK(frame); |
| VisibleSelection currentSelection = |
| frame->selection().computeVisibleSelectionInDOMTreeDeprecated(); |
| + const VisibleSelection& selectionForInsertion = |
| + createVisibleSelection(passedSelectionForInsertion); |
| String newText = text; |
| if (compositionType != TextCompositionUpdate) |