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

Issue 2466283002: [WIP Approach 2] Straighten up input method reactivation

Created:
4 years, 1 month ago by Changwan Ryu
Modified:
4 years, 1 month ago
Reviewers:
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, dtapuska+blinkwatch_chromium.org, creis+watch_chromium.org, yusukes+watch_chromium.org, shuchen+watch_chromium.org, nasko+codewatch_chromium.org, jam, nona+watch_chromium.org, darin-cc_chromium.org, agrieve+watch_chromium.org, blink-reviews, Navid Zolghadr, James Su
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Straighten up input method reactivation On Android, if you move focus from one input form to another, and type a word immediately, then sometimes the original text gets duplicated. The reason is that currently onCreateInputConnection() provides incorrect initial sel start and initial sel end values, and this ended up confusing the keyboard. The changes here include: 1) Ignore IME-initiated operations until restart input gets ACKed. Otherwise, IME operations targeted for the previous input form get applied to the next input form. This apply both to cancel composition and focused node change scenarios. For the deprecating ReplicaInputConnection model, we ignored IME-initiated operations whenever there was renderer-initiated conflict. We dropped the logic for ThreadedInputConnection model, but I think it’s useful when we have to restart input, so partially reviving the logic. 2) Update text input states before restarting input method. When CancelComposition and FocusedNodeChanged messages are sent in the middle of IME event guard, input method may see an outdated text input state when restarting input method. Therefore, we bypass IME event guard and send them immediately in these cases. 3) One problematic case in 2) is that text input states become garbage in the middle of a focus change. The reason is that VisibleSelection is not created in FocusController::setFocusedElement, but in a much later step. MouseEventManager::handleMouseFocus() -> FocusController::setFocusedElement() -> Document::setFocusedElement() -> RenderViewImpl::focusedNodeChanged() However, createVisibleSelection() is called in MouseEventManager::handleMousePressEvent(). One place we could create VisibleSelection was Document::setFocusedElement() -> Element::updateFocusAppearance() If we call the SelectionBehaviorOnFocus::Restore from MouseEventManager, selection values can be set correctly. BUG=650204 add logging

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -53 lines) Patch
M content/browser/renderer_host/render_widget_host_view_android.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/common/text_input_state.h View 1 chunk +3 lines, -0 lines 0 comments Download
M content/common/text_input_state.cc View 1 chunk +2 lines, -1 line 0 comments Download
M content/common/view_messages.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java View 3 chunks +5 lines, -9 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java View 1 chunk +1 line, -1 line 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java View 2 chunks +4 lines, -2 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java View 1 chunk +1 line, -1 line 0 comments Download
M content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java View 2 chunks +6 lines, -10 lines 0 comments Download
M content/renderer/render_view_browsertest.cc View 1 chunk +10 lines, -13 lines 0 comments Download
M content/renderer/render_view_impl.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M content/renderer/render_widget.h View 3 chunks +10 lines, -0 lines 0 comments Download
M content/renderer/render_widget.cc View 8 chunks +26 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/input/MouseEventManager.cpp View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (6 generated)
Changwan Ryu
The CQ bit was checked by changwan@chromium.org to run a CQ dry run
4 years, 1 month ago (2016-11-01 07:42:44 UTC) #1
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2466283002/1
4 years, 1 month ago (2016-11-01 07:42:56 UTC) #2
Changwan Ryu
Description was changed from ========== Straighten up input method reactivation On Android, if you move ...
4 years, 1 month ago (2016-11-01 07:46:10 UTC) #3
Changwan Ryu
Description was changed from ========== Straighten up input method reactivation On Android, if you move ...
4 years, 1 month ago (2016-11-01 08:08:05 UTC) #4
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
4 years, 1 month ago (2016-11-01 08:27:27 UTC) #5
commit-bot: I haz the power
4 years, 1 month ago (2016-11-01 08:27:28 UTC) #6
Dry run: Try jobs failed on following builders:
  win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED,
http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)

Powered by Google App Engine
This is Rietveld 408576698