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

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

Issue 2491763004: Revert of Utilize FrameSelection::setSelection() taking SelectionInDOMTree/SelectionInFlatTree (Closed)
Patch Set: 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 b618db2bc3f70868830da25a3e96d76c5111bb31..22f16bb5d2fbb913e4ac9ad7d32c472468662efe 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -177,8 +177,9 @@
// 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>
- frame().selection().setSelection(
- SelectionInDOMTree::Builder().setBaseAndExtent(range).build(), 0);
+ VisibleSelection selection;
+ selection.setWithoutValidation(range.startPosition(), range.endPosition());
+ frame().selection().setSelection(selection, 0);
}
bool InputMethodController::finishComposingText(
@@ -477,10 +478,11 @@
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(
- SelectionInDOMTree::Builder().setBaseAndExtent(deletionRange).build(),
- 0);
+ frame().selection().setSelection(selection, 0);
clear();
// FrameSeleciton::setSelection() can change document associate to |frame|.

Powered by Google App Engine
This is Rietveld 408576698