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

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

Issue 2370663002: Remove logic to reset input method more than needed (Closed)
Patch Set: fix test, fix IMC Created 3 years, 11 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 1b11d96ae61cb76ff1d74a0a80537ee9d18c8bf5..b329eecad3110e8891d2862f63706a89b83229a2 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -248,6 +248,10 @@ bool InputMethodController::finishComposingText(
return false;
if (confirmBehavior == KeepSelection) {
+ // Do not dismiss handles if we are not moving selection.
+ int selectionOptions = frame().selection().isHandleVisible()
+ ? FrameSelection::HandleVisible
+ : 0;
Changwan Ryu 2017/01/19 09:13:39 yosin@, could you take another look at this part?
yosin_UTC9 2017/01/19 09:29:51 This is yet another case |FrameSeleciton.isHandleV
Changwan Ryu 2017/01/19 11:42:59 Thanks for the pointer. I considered fixing FrameS
PlainTextRange oldOffsets = getSelectionOffsets();
Editor::RevealSelectionScope revealSelectionScope(&editor());
@@ -258,7 +262,7 @@ bool InputMethodController::finishComposingText(
// needs to be audited. see http://crbug.com/590369 for more details.
document().updateStyleAndLayoutIgnorePendingStylesheets();
- setSelectionOffsets(oldOffsets);
+ setSelectionOffsets(oldOffsets, selectionOptions);
// No DOM update after 'compositionend'.
dispatchCompositionEndEvent(frame(), composing);
@@ -441,22 +445,6 @@ void InputMethodController::cancelComposition() {
dispatchCompositionEndEvent(frame(), emptyString());
}
-void InputMethodController::cancelCompositionIfSelectionIsInvalid() {
- if (!hasComposition() || editor().preventRevealSelection())
- return;
-
- // Check if selection start and selection end are valid.
- FrameSelection& selection = frame().selection();
- if (!selection.isNone() && !m_compositionRange->collapsed()) {
- if (selection.start().compareTo(m_compositionRange->startPosition()) >= 0 &&
- selection.end().compareTo(m_compositionRange->endPosition()) <= 0)
- return;
- }
-
- cancelComposition();
- frame().chromeClient().didCancelCompositionOnSelectionChange();
-}
-
// If current position is at grapheme boundary, return 0; otherwise, return the
// distance to its nearest left grapheme boundary.
static size_t computeDistanceToLeftGraphemeBoundary(const Position& position) {
« no previous file with comments | « third_party/WebKit/Source/core/editing/InputMethodController.h ('k') | third_party/WebKit/Source/core/page/ChromeClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698