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

Issue 1126203013: Deal with backspace keycodes getting sent by IME during compositions. (Closed)

Created:
5 years, 7 months ago by aelias_OOO_until_Jul13
Modified:
5 years, 7 months ago
Reviewers:
CC:
chromium-reviews, darin-cc_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@2357
Target Ref:
refs/pending/branch-heads/2357
Project:
chromium
Visibility:
Public.

Description

Deal with backspace keycodes getting sent by IME during compositions. As of KitKat, the standard Google IME always calls deleteSurroundingText(1, 0) when the soft backspace button is pressed. But Jellybean and below instead mixed in a backspace key event into the IME stream, and the current Samsung keyboard still has this behavior. If we only forward such key events to Blink during an ongoing composition, then Blink will delete its string but the BaseInputConnection won't update its state, leading to a desync and strange bugs later. Our sendKeyEvent method already had a workaround to call deleteSurroundingText directly in such cases. sendKeyEvent is called when Samsung keyboard is used with Chrome, but WebView instead goes through the alternate Chrome.dispatchKeyEvent path. For that reason we currently have a Samsung+WebView specific desync bug. This patch changes dispatchKeyEvent to call sendKeyEvent, like https://codereview.chromium.org/759033002 did before it was reverted, to extend the workaround to WebView. This would have the unfortunate side effect of causing a bug with backspace key-repeats on physical keyboards, as the code there only applies backspace on keyup. So this patch changes it to keydown (which is better UX even aside from key repeat) and also forwards the system-supplied key events directly instead of throwing them out and generating artificial ones. BUG=483514 Review URL: https://codereview.chromium.org/1137673005 Cr-Commit-Position: refs/heads/master@{#329954} (cherry picked from commit 30b299cb04b4ba2330ef61a8a24c1e58513a0af2) Committed: https://chromium.googlesource.com/chromium/src/+/920cda4e38570116324cc086cba1327a53d630ca

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+132 lines, -34 lines) Patch
M content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java View 3 chunks +39 lines, -34 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java View 1 chunk +3 lines, -0 lines 0 comments Download
M content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java View 1 chunk +90 lines, -0 lines 0 comments Download

Messages

Total messages: 1 (0 generated)
aelias_OOO_until_Jul13
5 years, 7 months ago (2015-05-16 10:08:37 UTC) #1
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
920cda4e38570116324cc086cba1327a53d630ca.

Powered by Google App Engine
This is Rietveld 408576698