New issue
Advanced search Search tips

Issue 716123 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 490184



Sign in to add a comment

Chrome PDF Gesture Detector

Project Member Reported by dsinclair@chromium.org, Apr 27 2017

Issue description

Inside the gesture_detector.js code, when a Touch Start event is handled, we are calling preventDefault() on the event to stop native pinch zoom. This has the side effect that the 2 finger tap gesture no longer works to bring up the context menu.

We need to move the context menu to 2 finger tap for PDF so we can change the long press to text selection as the browser does.

I'm not sure if there is another way to hookup the gesture detector so we don't have to block the touch start? (Can we just listen for pinch or something?)
 

Comment 1 by mcnee@chromium.org, Apr 28 2017

Unfortunately, we only have access to the raw touch events. There are no gesture events that we can listen for instead. Fortunately, it should be enough to just preventDefault each of the touchmoves corresponding to the pinch updates instead of the initial touchstart.

Comment 2 by mcnee@chromium.org, May 1 2017

Status: Started (was: Assigned)
I have a fix for this ( https://codereview.chromium.org/2847893005/ ). Just waiting on reviewer availability.
Project Member

Comment 3 by bugdroid1@chromium.org, May 3 2017

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

commit fee63e1624e66315c67ac29c9d62e950944e012c
Author: mcnee <mcnee@chromium.org>
Date: Wed May 03 15:51:07 2017

PDF pinch-zoom: preventDefault on 2 finger touchmoves, not touchstarts.

Currently, to prevent native pinch-zoom from interfering with how we
handle pinch-zoom in the PDF viewer, we preventDefault the 2 finger
touchstart that corresponds to the gesture pinch start. However, this
also prevents 2 finger tap gestures.

We now preventDefault the 2 finger touchmoves so that native pinch-zoom
is still prevented, while 2 finger tap gestures are not affected.

BUG= 716123 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

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

[modify] https://crrev.com/fee63e1624e66315c67ac29c9d62e950944e012c/chrome/browser/resources/pdf/gesture_detector.js
[modify] https://crrev.com/fee63e1624e66315c67ac29c9d62e950944e012c/chrome/test/data/pdf/gesture_detector_test.js

Comment 4 by mcnee@chromium.org, May 3 2017

Status: Fixed (was: Started)

Sign in to add a comment