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

Issue 717337 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

Tapping insertion handle sometimes highlights word

Project Member Reported by amaralp@chromium.org, May 2 2017

Issue description

Chrome Version: M59
OS: Android

What steps will reproduce the problem?
(1) Type "Aaaa " text into a textarea. 
(2) Tap in "Aaaa" to get the insertion handle between two letters.
(3) Tap the insertion handle

What is the expected result?
"Select All, Paste" floating menu

What happens instead?
"Aaaa" gets highlighted
 
Cc: aelias@chromium.org
In desktop chrome when you right click on a misspelled word (with the red underline) the word is highlighted and the context menu gets shown. aelias@, do you know how Blink makes this selection?
I can't repro on 59.0.3071.25, menu appears as expected.  Are you sure
you're not double-tapping on the text itself?

Spelling is managed by DocumentMarker, but I don't follow how it can be
related to this.
> I can't repro on 59.0.3071.25, menu appears as expected.  Are you sure
you're not double-tapping on the text itself?

I'm not double-tapping and am able to reproduce it consistently. Also if the word isn't misspelled then the menu appears as expected.

> Spelling is managed by DocumentMarker, but I don't follow how it can be
related to this.

After crrev.com/2721813002, tapping on an insertion handle sends a contextmenu MouseEvent. I believe that this contextmenu event on a misspelled word causes the word to get selected.
Cc: rlanday@chromium.org
OK, makes sense.  rlanday@ is working on improving spellcheck support as we speak, he should be able to explain to you how it works.
I think I figured out where the selection happens; it's in |SelectionController::SendContextMenuEvent()|. I'll have to keep track of whether or not the contextmenu comes from tapping an insertion handle and not make a selection in that case.

Comment 6 by yosin@chromium.org, May 11 2017

Labels: M-60

Comment 7 by yosin@chromium.org, May 22 2017

Per #c5, SelectionController::SendContextMenuEvent() has

  if (HitTestResultIsMisspelled(mev.GetHitTestResult()))
    return SelectClosestMisspellingFromMouseEvent(mev);

Note: GetEditor().Behavior().ShouldSelectOnContextualMenuClick() returns false except for Mac.

Project Member

Comment 8 by bugdroid1@chromium.org, May 26 2017

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

commit 915818ef6101ba84d48f9b359f4418f702bca8e6
Author: amaralp <amaralp@chromium.org>
Date: Fri May 26 04:59:57 2017

Tapping handle shouldn't select misspelled word

After crrev.com/2721813002 tapping an insertion handle triggered a contextmenu event
which led to  bug 717337 . This CL fixes this bug by keeping track that the insertion
handle tap contextmenu event came from touch.

BUG= 717337 

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

[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/browser/renderer_host/input/touch_emulator.cc
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/browser/renderer_host/input/touch_emulator_client.h
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/browser/renderer_host/input/touch_emulator_unittest.cc
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/browser/renderer_host/input/touch_selection_controller_client_aura.cc
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/browser/renderer_host/render_widget_host_impl.cc
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/browser/renderer_host/render_widget_host_impl.h
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/browser/renderer_host/render_widget_host_view_android.cc
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/browser/renderer_host/render_widget_host_view_android.h
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/browser/renderer_host/render_widget_host_view_base.cc
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/browser/web_contents/web_contents_android.cc
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/browser/web_contents/web_contents_android.h
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/child/assert_matching_enums.cc
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/content/renderer/render_view_impl.cc
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/third_party/WebKit/Source/core/editing/SelectionController.cpp
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/third_party/WebKit/Source/core/input/EventHandler.cpp
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/third_party/WebKit/Source/core/input/EventHandler.h
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/third_party/WebKit/Source/web/WebViewImpl.cpp
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/third_party/WebKit/Source/web/WebViewImpl.h
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/third_party/WebKit/Source/web/tests/WebViewTest.cpp
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/third_party/WebKit/public/BUILD.gn
[add] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/third_party/WebKit/public/web/WebMenuSourceType.h
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/third_party/WebKit/public/web/WebView.h
[modify] https://crrev.com/915818ef6101ba84d48f9b359f4418f702bca8e6/ui/base/ui_base_types.h

Status: Fixed (was: Assigned)

Sign in to add a comment