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

Issue 628670 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Text selection not highlighted with Google Voice Keyboard

Reported by lge-systemwebview@lge.com, Jul 15 2016

Issue description

This report will ONLY be viewable by Google.

Device name:Nexus 5
Android version:6.0.1
Fingerprint:
WebView version: 52.0.2743.62
Chrome Browser version:51.0.2704.81
Google Keyboard: 5.0.25.122319759

URLs (if applicable):
https://sceditor.com

Steps to reproduce:
(1)Install Google Keyboard with default language as English(US)
(2)Open any webview app or chrome Browser
(3)Open any editor URL Ex:https://sceditor.com
(4)Open "Google Voice Typing" keyboard
(5)Select Some text

Expected result:
Selected Text should be highlighted

Actual result:
Selection handlers are correctly displayed but selection is not highlighted


 
Attached screenshots
Chrome.png
122 KB View Download
WebView.png
99 KB View Download

Comment 2 by sgu...@chromium.org, Jul 22 2016

Owner: ti...@chromium.org
Hi, 
Any updates on this issue?
Hi, 
Any updates on this issue?

Comment 5 by ti...@chromium.org, Feb 7 2017

I'm sorry this was delayed. I could not reproduce the issue with the latest version of WebView, can you try it with latest release (M56) ?
Issue is reproduced with 56.0.2924.87 version. Please let us know exact version where issue is not reproduced.

Comment 7 by ti...@chromium.org, Feb 16 2017

Cc: changwan@chromium.org
Yes, sorry about #5, I did not use the voice typing.

When the voice typing "keyboard" is active the selection is underlined but not highlighted, when a user switches back to regular on-screen keyboard the selection becomes highlighted and not underlined.

The underlined portion of the text can only select the whole words.

The same happens with Chrome (texted on Google Pixel, latest ToT), I wonder whether it is a feature.

+changwan@
Components: -Mobile>WebView Blink>Paint
Status: Available (was: Unconfirmed)
Blink does not correct 'draw' underline and highlight at the same time. Actually the text is correctly selected and you can cut or copy the text.
sorry about the typo: correctly*

Comment 10 by ti...@chromium.org, Feb 17 2017

Owner: ----
Do you know what it is that causes the underline? Is it a CSS style?

Comment 12 by pdr@chromium.org, Feb 17 2017

Cc: aelias@chromium.org
FWIW, this doesn't seem to happen in native UI (e.g., calendar). I'm still not sure if it's intended though.

I haven't built android to check, but I think this is drawn in https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/paint/TextPainter.cpp?

@aelias, do you have any context here?
Owner: rlanday@chromium.org
Status: Assigned (was: Available)
Summary: Text selection not highlighted with Google Voice Keyboard (was: Text Selection not highlighted with Google Keyboard)
I can still repro on 58.0.3014.0.  It looks like voice keyboard is issuing a black underline span across any active selection, which is additive to the selection highlight on native TextViews, but clobbers it in Blink.  rlanday@ is currently actively working on the underline markers for voice IME, so assigning this for his backlog.
The clobbering occurs here:
https://chromium.googlesource.com/chromium/src/+/ba67e74fd455e9f581c1cffc503a2ad10e4e5fa9/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp#404

If we remove the !PaintsCompositionMarkers(text_box_layout_object) check, we do get both the selection highlight and the composition underline painted together.

This logic has been around for over a decade so I'm having trouble finding context for why the behavior was originally added. One possible reason is that a composition underline can potentially have a background color associated with it (not the case here), in which case me might possibly not want to paint the selection background (e.g. if the IME selected the text and wants to display it in a custom way)?

aelias, what do you think we should do here? Do you think removing this check will cause any issues?
Labels: BugSource-Chromium PaintTeamTriaged-20170523
It's likely because it can set a background color, yes.  Instead of removing it completely, how about replacing it with a check for a background-type marker?
Re #14, FWIW actually webpages can change text selection color using css: https://css-tricks.com/examples/DifferentSelectionColors/, so there is a chance that composition becomes invisible if the colors collide.
There's also a preexisting problem that composition underlines are already invisible on black backgrounds, even without selection.

I tracked this back to http://crrev.com/6ddad53de2830852 .  There's no explanation for why this is needed and I don't think composition background colors existed back then, so my theory in #16 is likely wrong.  It seems like just some kind of precaution imagining that selection color and underline color might clash, but it's hard to see what scenario.  Generally, during IME compositions, there is a single cursor rather than a selection range, so I don't even know when it might come up.  So I guess we can try just deleting it.
Thanks for pointing it out, I agree.
Project Member

Comment 20 by bugdroid1@chromium.org, Jun 1 2017

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

commit 1053faaf3d0458556000acde907116a5d869c815
Author: rlanday <rlanday@chromium.org>
Date: Thu Jun 01 03:50:50 2017

Show selection highlight even if we have a composition underline

We currently have some logic (dating back to 2005) to not show the selection
highlight if we're also showing a composition underline. We're not 100% sure
why this (probably to avoid some sort of interaction between the selection
color and the underline), but we think it's unnecessary. There are already
certain interactions we don't do anything about, for example the composition
underline matching the background color of the text.

This CL removes this logic so we can show the selection highlight while the
Android Voice IME (which keeps an underlined composition range open) is
active.

BUG= 628670 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2896273003
Cr-Commit-Position: refs/heads/master@{#476178}

[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/paint/selection/text-selection-with-composition.html
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/linux/paint/selection/text-selection-with-composition-expected.png
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/linux/paint/selection/text-selection-with-composition-expected.txt
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/selection/text-selection-with-composition-expected.png
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/selection/text-selection-with-composition-expected.txt
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-mac10.10/paint/selection/text-selection-with-composition-expected.png
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-mac10.10/paint/selection/text-selection-with-composition-expected.txt
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/disable-spinvalidation/paint/selection/text-selection-with-composition-expected.png
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/disable-spinvalidation/paint/selection/text-selection-with-composition-expected.txt
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-mac10.11/paint/selection/text-selection-with-composition-expected.png
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-mac10.11/paint/selection/text-selection-with-composition-expected.txt
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/disable-spinvalidation/paint/selection/text-selection-with-composition-expected.png
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/disable-spinvalidation/paint/selection/text-selection-with-composition-expected.txt
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/selection/text-selection-with-composition-expected.png
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/selection/text-selection-with-composition-expected.txt
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/selection/text-selection-with-composition-expected.png
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/selection/text-selection-with-composition-expected.txt
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-retina/paint/selection/text-selection-with-composition-expected.png
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-retina/paint/selection/text-selection-with-composition-expected.txt
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/disable-spinvalidation/paint/selection/text-selection-with-composition-expected.png
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/disable-spinvalidation/paint/selection/text-selection-with-composition-expected.txt
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-with-composition-expected.png
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-with-composition-expected.txt
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/selection/text-selection-with-composition-expected.png
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/selection/text-selection-with-composition-expected.txt
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-with-composition-expected.png
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-with-composition-expected.txt
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/selection/text-selection-with-composition-expected.png
[add] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/selection/text-selection-with-composition-expected.txt
[modify] https://crrev.com/1053faaf3d0458556000acde907116a5d869c815/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp

Status: Fixed (was: Assigned)
Will be fixed in M61. Is it OK to remove the Restrict-View-Google tag?
Yes... it is okay to remove the restrict tag
Labels: -Restrict-View-Google
Verified Fixed in Last Chrome build on Nexus 5/LMY49K(5.1.1)

Sign in to add a comment