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

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

Issue 2457613004: Utilize FrameSelection::setSelection() taking SelectionInDOMTree/SelectionInFlatTree (Closed)
Patch Set: 2016-10-28T15:45:56 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/InputMethodController.cpp
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
index 22f16bb5d2fbb913e4ac9ad7d32c472468662efe..b618db2bc3f70868830da25a3e96d76c5111bb31 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -177,9 +177,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(
@@ -478,11 +477,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* const currentDocument = frame().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