New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 683387 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 630137
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Blocked on:
issue 630137

Blocking:
issue 672259



Sign in to add a comment

Android text composition underlines are buggy when tapping between words

Project Member Reported by rlanday@chromium.org, Jan 20 2017

Issue description

Chrome Version: 55.0.2883.91
OS: Android 7.1.2

What steps will reproduce the problem?
(1) Go to editpad.org
(2) Type some text (several words separated by spaces)
(3) Tap back and forth between the words

What is the expected result?

The black underline marking the composition range should always be correctly positioned under a word.

What happens instead?

The underline is kind of jumpy and will go through an intermediate state where it seems to have the correct length for the final underline but will be positioned incorrectly.
 
This behavior seems to be caused by InputMethodManagerWrapper calling getInputMethodManager().restartInput(view), which causes the IME to try to re-acquire state, apparently without properly picking up the new selection. Commenting out the call here fixes the problem:
https://cs.chromium.org/chromium/src/content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java?q=InputMethodManagerWrapper.java&sq=package:chromium&dr&l=45

Currently investigating a solution

Comment 2 by aelias@chromium.org, Jan 24 2017

There's a pending patch https://codereview.chromium.org/2370663002/ removing those restartInput calls, I'm guessing that probably fixes it?

Comment 3 Deleted

Yes, I've confirmed that that patch will fix this issue.

Comment 5 by aelias@chromium.org, Jan 24 2017

Blockedon: 630137
Cc: changwan@chromium.org alek...@chromium.org
Labels: Needs-Bisect
I have some doubt that removing restartInput on selection change can completely fix the issue because there are other events that can lead to restartinput, such as focus change and cancel composition.

Also, at the time IME redesign landed on M54, I did not see this.

I suspect that Blink change caused this, and it may help understand what happened. Therefore requesting a full bisect.

Labels: -Pri-2 Pri-1
I think b/35198308 and b/34961224 are likely caused by this issue, so raising priority.

Comment 8 by aelias@chromium.org, Feb 10 2017

Cc: rlanday@chromium.org
Owner: changwan@chromium.org
Ryan's not an expert on this issue, so assigning to you if you think it's worth investigating further.

I suspect removing cursor restartInput probably helped with the majority of the cases so the severity might at least be lower as of M58.
Hmm... This is still happening on ToT with the following scenario:

1) Go to textarea.org
2) Type 'Abcde'
3) Type enter
4) Type 'Abcde' again

However, it does not happen on stable version (55.0.2883.91). I suspect that Google Keyboard recognizes that it's Chrome stable and do some workaround.

Or it could be Google Keyboard's own issue. Let me look into it.

You can test the theory about Google Keyboard checking for Chrome Stable by installing a new ChromeStable.apk build from https://pantheon.corp.google.com/storage/browser/chrome-signed/android-B0urB0N/, and seeing if the same version ChromeCanary.apk behaves different.

Comment 11 by aluo@chromium.org, Feb 14 2017

Cc: aluo@chromium.org

Comment 12 by aluo@chromium.org, Feb 15 2017

Labels: -Needs-Bisect ReleaseBlock-Stable M-57
I could reproduce issue described in bug description all the way back to M51 if I use multiple lines of text.

The issue in comment 9 is due to: https://codereview.chromium.org/2568093003
Labels: -Pri-1 -ReleaseBlock-Stable -M-57 Pri-2
Status: Assigned (was: Started)
I split off the bug in #9 into  http://crbug.com/692699  for clarity.  Reserving this issue for preexisting problem.
Blockedon: -630137
Mergedinto: 630137
Status: Duplicate (was: Assigned)
Confirmed that https://codereview.chromium.org/2370663002 fixed this issue as well. Marking as dup because it has the same root cause.
Blockedon: 630137

Sign in to add a comment