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

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

Issue 2442673002: Get rid of createVisibleSelection() taking one Position (Closed)
Patch Set: 2016-10-24T17:42:38 Created 4 years, 2 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/InsertTextCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp
index 24761bfe0437828c4fb5e1c67a3945386025a436..dedda26481f4c9ea7ab4887abc8ff1ddb2f2dde7 100644
--- a/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp
@@ -283,9 +283,12 @@ void InsertTextCommand::doApply(EditingState* editingState) {
if (!m_selectInsertedText) {
document().updateStyleAndLayoutIgnorePendingStylesheets();
- setEndingSelection(createVisibleSelection(
- endingSelection().end(), endingSelection().affinity(),
- endingSelection().isDirectional()));
+ SelectionInDOMTree::Builder builder;
+ builder.setAffinity(endingSelection().affinity());
+ builder.setIsDirectional(endingSelection().isDirectional());
+ if (endingSelection().end().isNotNull())
+ builder.collapse(endingSelection().end());
+ setEndingSelection(createVisibleSelection(builder.build()));
}
}

Powered by Google App Engine
This is Rietveld 408576698