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

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

Issue 1773443002: Revert of Simplify TypingCommand::insertText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/core/editing/commands/TextInsertionBaseCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/TextInsertionBaseCommand.cpp b/third_party/WebKit/Source/core/editing/commands/TextInsertionBaseCommand.cpp
index 6a0bbda380948c771f5a8cf2db9720cd65ee810c..4cfbda5925ab3f25aacd8bdcff551c116331a29c 100644
--- a/third_party/WebKit/Source/core/editing/commands/TextInsertionBaseCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/TextInsertionBaseCommand.cpp
@@ -39,4 +39,18 @@ TextInsertionBaseCommand::TextInsertionBaseCommand(Document& document)
{
}
+void TextInsertionBaseCommand::applyTextInsertionCommand(LocalFrame* frame, PassRefPtrWillBeRawPtr<TextInsertionBaseCommand> command, const VisibleSelection& selectionForInsertion, const VisibleSelection& endingSelection)
+{
+ bool changeSelection = !equalSelectionsInDOMTree(selectionForInsertion, endingSelection);
+ if (changeSelection) {
+ command->setStartingSelection(selectionForInsertion);
+ command->setEndingSelection(selectionForInsertion);
+ }
+ command->apply();
+ if (changeSelection) {
+ command->setEndingSelection(endingSelection);
+ frame->selection().setSelection(endingSelection);
+ }
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698