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

Issue 787665 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

[Smart Selection] reset is not properly logged sometimes.

Project Member Reported by ctzsm@chromium.org, Nov 22 2017

Issue description

While debugging with issue 787370, I found that sometimes reset is not get logged.

By taking a closer look, this is because in SelectionController, we are calling ShowNonLocatedContextMenu() to trigger selection menu, which will generate a pair of mock coordinates according to the selection at that point.

However, in ContextMenuClient::ShowContextMenu(), we are using this coordinates to check if it's inside current selection. Unfortunately, that doesn't work correctly sometimes.

It affects reset logging only.
 

Comment 1 by ctzsm@chromium.org, Nov 22 2017

As discussed, one solution is to add an additional offset to the X part of the coordinates.

Comment 2 by ctzsm@chromium.org, Nov 22 2017

BTW, I tried more address, only one of them has this problem in Chrome, same webpage in WebView Shell doesn't repro. Copy paste this to gmail, doesn't repro either.
Cc: donnd@chromium.org
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 23 2017

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

commit c19bd1dbd9bf350b63f7835f4a80ebdba3b44684
Author: Shimi Zhang <ctzsm@chromium.org>
Date: Thu Nov 23 20:55:23 2017

[Smart Selection] Fix Reset logging issue

Sometimes Smart Selection logging is not triggered because we false
detected that there is no selection.

ShowNonLocatedContextMenu() is making coordinates according to
current selection rect. However, sometimes that doesn't satisfy a check
later on in ContextMenuClient::ShowContextMenu. In that check, We
converted coordinates to character position in current element then
compare with selection range.

We need to make sure the coordinates are in the current selection
range, this CL checks if the current ShowContextMenu call is from
Smart Selection reset, means it passed the previous inside check
already.

Bug:  787665 
Change-Id: I6c6792d54f6f205644719b68f7602e6b4332b056
Reviewed-on: https://chromium-review.googlesource.com/784129
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Changwan Ryu <changwan@chromium.org>
Commit-Queue: Changwan Ryu <changwan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519020}
[modify] https://crrev.com/c19bd1dbd9bf350b63f7835f4a80ebdba3b44684/third_party/WebKit/Source/core/page/ContextMenuClient.cpp

Comment 5 by ctzsm@chromium.org, Dec 4 2017

Status: Fixed (was: Assigned)

Sign in to add a comment