Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp

Issue 2733183002: Make TypingCommand::insertText() to take SelectionInDOMTree instead of VisibleSelection (Closed)
Patch Set: 2017-03-07T14:18:09 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/TypingCommand.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/TypingCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698