Issue 787598 in chromium: Undo is super-wonky when typing with IME (e.g. most typing on Android)

2 views
Skip to first unread message

rlan… via monorail

unread,
Nov 21, 2017, 4:51:48 PM11/21/17
to editi...@chromium.org
Status: Untriaged
Owner: ----
CC: editi...@chromium.org, xiaoche...@chromium.org, tedc...@chromium.org, ama...@chromium.org
Components: Blink>Editing>IME
OS: Linux Android Windows Chrome Mac Fuchsia
Pri: 3
Type: Bug

New issue 787598 by rla...@chromium.org: Undo is super-wonky when typing with IME (e.g. most typing on Android)
https://bugs.chromium.org/p/chromium/issues/detail?id=787598

Chrome Version: 64.0.3274.0 (Developer Build) unknown (32-bit)
OS: Android N

What steps will reproduce the problem?
(1) Set up an Android device with Gboard and also a physical keyboard. Enable showing the on-screen keyboard while the physical keyboard is connected.
(2) Go to editpad.org and type a few words (on either keyboard).
(3) Repeatedly press Ctrl-Z on the physical keyboard to undo the typing.

What is the expected result?

Undo should work as it does on other platforms, where undo removes several words (e.g. a sentence) at a time.

What happens instead?

Undo undoes one character at a time, and causes the word with a character being removed from it to become selected.

This happens because InputMethodController::SetComposition() works by selecting the composition range (which closes out the previous TypingCommand, putting it on the undo stack; this is why undo happens one character at a time), replacing the selection, and then converting the selection back to a composition range (without updating the selection in the open TypingCommand; this is why undo selects the words).

I tested typing in Japanese on macOS and similar behavior resulted.

This bug would affect Android particularly badly (since pretty much all on-screen keyboards use composition ranges for composing text, even for alphabetic languages), except the only way I know of triggering undo on Android is pressing Ctrl-Z on a physical keyboard. If we ever want to expose undo in the UI, fixing this bug will become high-pri.

--
You received this message because:
1. You were specifically CC'd on the issue
2. You are auto-CC'd on all issues in component Blink>Editing>IME

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

rlan… via monorail

unread,
Nov 21, 2017, 4:52:23 PM11/21/17
to editi...@chromium.org
Updates:
Owner: rla...@chromium.org
Status: Started

Comment #1 on issue 787598 by rla...@chromium.org: Undo is super-wonky when typing with IME (e.g. most typing on Android)
https://bugs.chromium.org/p/chromium/issues/detail?id=787598#c1

(No comment was entered for this change.)

Attachments:
android undo.mp4 297 KB

bugdro… via monorail

unread,
Dec 1, 2017, 12:05:11 AM12/1/17
to editi...@chromium.org

Comment #2 on issue 787598 by bugd...@chromium.org: Undo is super-wonky when typing with IME (e.g. most typing on Android)
https://bugs.chromium.org/p/chromium/issues/detail?id=787598#c2

The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src.git/+/812d7fc095e9093848a6207eaa635772a7bb52f4

commit 812d7fc095e9093848a6207eaa635772a7bb52f4
Author: Ryan Landay <rla...@chromium.org>
Date: Fri Dec 01 05:04:21 2017

Fix incorrect ending selection after InputMethodController::SetComposition()

InputMethodController::SetComposition() works as follows:

1. The current composition range is selected (we don't show this to users).
2. The selection is replaced with the new text, which is left selected.
3. The resulting selection is converted to a composition range, and we change
the selection to whatever the IME requested be selected afterwards.

Step 2 causes the open TypingCommand's ending selection to be set to the
resulting composition range. We need to update it after step 3 to fix two
problems:

1. Pressing enter on a physical keyboard on Android with an open composition
range causes the text in the composition range to be incorrectly deleted.

2. Pressing Ctrl-Z to undo causes each word to be selected in turn (see video on
https://crbug.com/787598).

There's another problem with undo on Android, which is that the TypingCommand is
closed out after every call to SetComposition() when we select the composition,
which means undo only undoes one character at a time. I might fix this in a
separate CL.

Bug: 787598, 772565, 772584
Change-Id: I29f09e3c0bd97c6c8e17e5455c5579b53aa34c1b
Reviewed-on: https://chromium-review.googlesource.com/783770
Commit-Queue: Ryan Landay <rla...@chromium.org>
Reviewed-by: Changwan Ryu <chan...@chromium.org>
Reviewed-by: Xiaocheng Hu <xiaoc...@chromium.org>
Reviewed-by: Yoshifumi Inoue <yo...@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520857}
[modify] https://crrev.com/812d7fc095e9093848a6207eaa635772a7bb52f4/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
[modify] https://crrev.com/812d7fc095e9093848a6207eaa635772a7bb52f4/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java
[modify] https://crrev.com/812d7fc095e9093848a6207eaa635772a7bb52f4/third_party/WebKit/Source/core/editing/commands/TypingCommand.h
[modify] https://crrev.com/812d7fc095e9093848a6207eaa635772a7bb52f4/third_party/WebKit/Source/core/editing/ime/InputMethodController.cpp
[modify] https://crrev.com/812d7fc095e9093848a6207eaa635772a7bb52f4/third_party/WebKit/Source/core/editing/ime/InputMethodControllerTest.cpp

rlan… via monorail

unread,
Feb 1, 2018, 1:27:21 PM2/1/18
to editi...@chromium.org
Updates:
Cc: rla...@chromium.org
Owner: ----
Status: Available

Comment #3 on issue 787598 by rla...@chromium.org: Undo is super-wonky when typing with IME (e.g. most typing on Android)
https://bugs.chromium.org/p/chromium/issues/detail?id=787598#c3


(No comment was entered for this change.)

sheriff… via monorail

unread,
Feb 4, 2019, 12:05:34 PM2/4/19
to editi...@chromium.org
Updates:
Labels: Hotlist-Recharge-Cold
Status: Untriaged

Comment #4 on issue 787598 by sheri...@chromium.org: Undo is super-wonky when typing with IME (e.g. most typing on Android)
https://bugs.chromium.org/p/chromium/issues/detail?id=787598#c4

This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

sheriffbot via monorail

unread,
Feb 17, 2020, 11:49:01 AM2/17/20
to editi...@chromium.org
Updates:
Status: Untriaged

Comment #6 on issue 787598 by sheriffbot: Undo is super-wonky when typing with IME (e.g. most typing on Android)
https://bugs.chromium.org/p/chromium/issues/detail?id=787598#c6


This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

--
You received this message because:
1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment or make updates.

sheriffbot via monorail

unread,
Feb 19, 2021, 12:01:20 PM2/19/21
to editi...@chromium.org
Updates:
Status: Untriaged

Comment #8 on issue 787598 by sheriffbot: Undo is super-wonky when typing with IME (e.g. most typing on Android)
https://bugs.chromium.org/p/chromium/issues/detail?id=787598#c8

siliu via monorail

unread,
Feb 19, 2021, 1:37:45 PM2/19/21
to editi...@chromium.org
Updates:
Status: Available

Comment #9 on issue 787598 by si...@microsoft.com: Undo is super-wonky when typing with IME (e.g. most typing on Android)
https://bugs.chromium.org/p/chromium/issues/detail?id=787598#c9


(No comment was entered for this change.)

sheriffbot via monorail

unread,
Feb 21, 2022, 12:02:59 PM2/21/22
to editi...@chromium.org
Updates:
Status: Untriaged

Comment #10 on issue 787598 by sheriffbot: Undo is super-wonky when typing with IME (e.g. most typing on Android)
https://bugs.chromium.org/p/chromium/issues/detail?id=787598#c10


This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

shihken via monorail

unread,
Feb 25, 2022, 3:48:48 AM2/25/22
to editi...@chromium.org
Updates:
Status: Available

Comment #11 on issue 787598 by shi...@microsoft.com: Undo is super-wonky when typing with IME (e.g. most typing on Android)
https://bugs.chromium.org/p/chromium/issues/detail?id=787598#c11


(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages