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

Issue 2464023002: Fix endBatchEdit

Created:
4 years, 1 month ago by Changwan Ryu
Modified:
4 years, 1 month ago
CC:
agrieve+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, jam, mlamouri+watch-content_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix endBatchEdit If we call endBatchEdit() and then call getExtractedText() immediately, then sometimes InputMethodManager#updateSelection() is not called. The reason is that getExtractedText() is already block-waiting for a new state, and endBatchEdit() was piggy-backing on FROM_IME to enforce a state update. In the above scenario, the update from endBatchEdit() gets consumed by getExtractedText(), and there is no separate updateSelection(). The more natural change source for a state update at the end of a batch edit is actually FROM_NON_IME, which does not interfere with the block-wait mechanism of get* methods. The state update order in the above scenario is fixed because blockAndGetStateUpdate() handles it correctly when it's FROM_NON_IME. Since state updates in batch mode got ignored in ThreadedInputConnection, We still need to force-update text input state at the end of a batch edit. This ensures InputMethodManager#updateSelection() is called at the end of a batch edit when there was a change. BUG=659934

Patch Set 1 #

Patch Set 2 : fix testBatchEdit_NoOp #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+129 lines, -81 lines) Patch
M content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java View 2 chunks +2 lines, -7 lines 2 comments Download
M content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java View 1 5 chunks +39 lines, -10 lines 0 comments Download
M content/renderer/render_widget.h View 1 chunk +9 lines, -0 lines 0 comments Download
M content/renderer/render_widget.cc View 2 chunks +79 lines, -64 lines 3 comments Download

Messages

Total messages: 11 (7 generated)
Changwan Ryu
PTAL.
4 years, 1 month ago (2016-11-01 06:25:20 UTC) #8
aelias_OOO_until_Jul13
https://codereview.chromium.org/2464023002/diff/20001/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java File content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java (right): https://codereview.chromium.org/2464023002/diff/20001/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java#newcode221 content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java:221: if (textInputState.inBatchEditMode()) return; Please delete this and restore the ...
4 years, 1 month ago (2016-11-01 23:37:31 UTC) #9
Changwan Ryu
https://codereview.chromium.org/2464023002/diff/20001/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java File content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java (right): https://codereview.chromium.org/2464023002/diff/20001/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java#newcode221 content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java:221: if (textInputState.inBatchEditMode()) return; On 2016/11/01 23:37:30, aelias wrote: > ...
4 years, 1 month ago (2016-11-01 23:58:50 UTC) #10
aelias_OOO_until_Jul13
4 years, 1 month ago (2016-11-02 00:58:40 UTC) #11
On 2016/11/01 at 23:58:50, changwan wrote:
> Hmm... The problem with early-return in renderer is, as you pointed out, 
SHOW_IME may get suppressed if it were in the middle of a batch edit. Maybe we
could keep a separate flag, e.g., ime_batch_edit_show_ime_ and deliver it at the
end of a batch edit. But then show_ime timing may change.

Yeah, as discussed offline, let's try the separate flag thing.

Powered by Google App Engine
This is Rietveld 408576698