New issue
Advanced search Search tips

Issue 786419 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 11
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome
Pri: 2
Type: Bug

Blocked on:
issue 759042



Sign in to add a comment

PDF viewer: pinch zoom invokes native browser zoom due to uncancellable touchmove event

Project Member Reported by mcnee@chromium.org, Nov 17 2017

Issue description

Chrome Version: 64.0.3271.0

What steps will reproduce the problem?
(1) Touch scroll a PDF.
(2) During the scroll, place a second finger on the screen and immediately pinch.

When we try to preventDefault the touchmove in order to prevent the browser's native pinch zoom, we get the following intervention:
gesture_detector.js:137 [Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.
onTouch_ @ gesture_detector.js:137


Since the event could not be cancelled, the browser's native pinch zoom is invoked.
 

Comment 1 by mcnee@chromium.org, Nov 17 2017

So I tried setting the touch-action CSS property to avoid the need to preventDefault the touch events.

"touch-action: pan-x pan-y;" should disable the native pinch, but it doesn't seem to work in the viewer. touch-action can still disable panning in the viewer, just not pinching. Perhaps there's an out-of-process related issue for touch-action.

Comment 2 by mcnee@chromium.org, Nov 17 2017

Blockedon: 759042

Comment 3 by mcnee@chromium.org, Nov 17 2017

Blockedon: 771330
So it looks like touch-action doesn't currently prevent pinching if the gesture started as a scroll.
Blockedon: -771330
Cc: bokan@chromium.org
Status: Started (was: Assigned)
The workaround at https://chromium-review.googlesource.com/c/chromium/src/+/1040354 also applies to this case, so we aren't blocked on 771330 anymore.

I'll switch the viewer over to touch-action.
Project Member

Comment 5 by bugdroid1@chromium.org, Oct 2

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

commit bb2f75c1874be503a1468688bf0510d01be50b49
Author: Kevin McNee <mcnee@chromium.org>
Date: Tue Oct 02 21:59:48 2018

PDF Viewer: Use touch-action to disable native pinch zoom

We currently call preventDefault on two finger touchmoves to prevent
the browser's native pinch zoom from interfering with the PDF viewer's
own pinch zoom implementation. However, an intervention may prevent
such an event from being cancelable. It also doesn't consider the case
of touchscreen double-tap on Chrome OS in tablet mode.

touch-action is now able to prevent touchscreen pinches in an
OOPIF/BrowserPlugin, so we now use touch-action for the viewer.

Bug:  786419 
Change-Id: I4eeb3be4566db3c48f0b2ad461cafe0568379fe1
Reviewed-on: https://chromium-review.googlesource.com/c/1247040
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595997}
[modify] https://crrev.com/bb2f75c1874be503a1468688bf0510d01be50b49/chrome/browser/resources/pdf/gesture_detector.js
[modify] https://crrev.com/bb2f75c1874be503a1468688bf0510d01be50b49/chrome/browser/resources/pdf/index.css
[modify] https://crrev.com/bb2f75c1874be503a1468688bf0510d01be50b49/chrome/test/data/pdf/gesture_detector_test.js

Status: Fixed (was: Started)
Just wondering when this fix can be expected to be merged into a dev channel?
It's in 71.0.3569.0 and newer, so it's already in the current Beta and Dev channels.

Sign in to add a comment