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

Unified Diff: third_party/WebKit/Source/core/editing/InputMethodController.cpp

Issue 2457613004: Utilize FrameSelection::setSelection() taking SelectionInDOMTree/SelectionInFlatTree (Closed)
Patch Set: 2016-11-24T13:04:01 Rebase Created 4 years, 1 month 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/InputMethodController.cpp
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
index fa406b5295850c63a436280e4e7d1fe9ee70786c..7ea7742c99c4147b0129ca65a949a61ab1fe3c91 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -216,9 +216,8 @@ void InputMethodController::selectComposition() const {
// The composition can start inside a composed character sequence, so we have
// to override checks. See <http://bugs.webkit.org/show_bug.cgi?id=15781>
- VisibleSelection selection;
- selection.setWithoutValidation(range.startPosition(), range.endPosition());
- frame().selection().setSelection(selection, 0);
+ frame().selection().setSelection(
+ SelectionInDOMTree::Builder().setBaseAndExtent(range).build(), 0);
}
bool InputMethodController::finishComposingText(
@@ -525,11 +524,10 @@ void InputMethodController::setCompositionWithIncrementalText(
compositionStart + composing.length() - commonSuffixLength;
const EphemeralRange& deletionRange =
PlainTextRange(deletionStart, deletionEnd).createRange(*editable);
- VisibleSelection selection;
- selection.setWithoutValidation(deletionRange.startPosition(),
- deletionRange.endPosition());
Document& currentDocument = document();
- frame().selection().setSelection(selection, 0);
+ frame().selection().setSelection(
+ SelectionInDOMTree::Builder().setBaseAndExtent(deletionRange).build(),
+ 0);
clear();
// FrameSeleciton::setSelection() can change document associate to |frame|.

Powered by Google App Engine
This is Rietveld 408576698