New issue
Advanced search Search tips

Issue 805075 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome
Pri: 2
Type: Task

Blocking:
issue 804276



Sign in to add a comment

TouchSelectionController shouldn't maintain its own selection handle visibility state

Project Member Reported by amaralp@chromium.org, Jan 23 2018

Issue description

Chrome Version: All
OS: Android/Windows/Linux/CrOS (any platform with touch)
What steps will reproduce the problem?
This is a code structure problem so there are many different problems.
Here is an example that is reproducible on Window/Linux/CrOS
(1) Long-press an empty input field (notice that the blue touch handle shows up)
(2) Move your mouse (notice the blue touch handle disappears)
(3) Long-press the empty input field (notice the blue touch handle isn't showing)

What is the expected result?
After the second long-press the touch handle was not shown.

What happens instead?
The touch handle should have reappeared.

The issue here is that when we move the mouse the handle is cleared in the browser [1] but not in the renderer. This means that the renderer (in particular the FrameSelection) still thinks the handle is present. When the user does a new long-press the renderer thinks there is no change in the selection [2] so it doesn't tell the browser to re-show the handle.

The underlying problem here is allowing the browser to change the selection handle visibility without notifying the renderer. I think the right solution is to send an IPC to the renderer to clear the handle and to get rid of the |show_touch_handles_| in |TouchSelectionController|. The problem with this solution is that |TouchSelectionController| wouldn't know which renderer to send the message to. mohsen@, do you have any ideas on this?

[1] https://cs.chromium.org/chromium/src/content/browser/renderer_host/input/touch_selection_controller_client_aura.cc?rcl=5a82fc5c7cda26056d495448b176a59fd0031e36&l=112

[2] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/editing/SelectionController.cpp?rcl=2b2f89789e133c8904e505250e415699def7dea1&l=893
 
Blocking: 804276
Is this regression? Could you bisect it?

Comment 3 by moh...@chromium.org, Jan 24 2018

Regarding the question of how to know which renderer to send the message to, TouchSelectionController already sends selection movement messages to the appropriate renderer when a handle is dragged. Can we use a similar approach here?
yoichio@, handle visibility was moved into blink with this patch: https://chromium.googlesource.com/chromium/src/+/1107a295dcee2f4ee3f6c24f836c6adfa7b3830d
That landed a year ago and this issue would have been present since then.

mohsen@, that may work. Does each child frame get it's own TouchSelectionController? I'm thinking of the case where touch handles are visible in the parent frame and the mouse is moved in the child frame (or vice versa). What would be the expected behavior?

Comment 5 by yosin@chromium.org, May 29 2018

Cc: -yosin@chromium.org
Components: -Blink>Editing>Selection
Labels: -Pri-1 -Type-Bug Pri-2 Type-Task
Lower to Pri-2 since this is not urgent.

Sign in to add a comment