New issue
Advanced search Search tips

Issue 632525 link

Starred by 3 users

Issue metadata

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

Blocking:
issue 681775



Sign in to add a comment

If pinch-zoom is disabled with touch-action, then 2 finger scrolling should also be disabled

Project Member Reported by rbyers@chromium.org, Jul 28 2016

Issue description

What should happen if you drag with two fingers on a 'touch-action: pan-x pan-y' region? Unfortunately this is out of scope of the PE spec for charter / IP reasons.  Chrome currently scrolls but Edge does not.  I think it's important that we match Edge's behavior of suppressing these scrolls as well.

In particular some sites implement a UX where a single finger scrolls as normal, but dragging with two fingers drives some custom effect instead of the browser's default behavior.

 
Owner: mustaq@chromium.org
Status: Assigned (was: Available)
The touch-action spec extension in whatwg now defines pinch-zoom to include multi-finger panning. This is what Edge does.

Here is a demo that works in Edge but not in Chrome: http://mustaqahmed.github.io/web/image-panning.html
I see two possible approaches to fix this:

Option A: Redefine when gesture-pinch-begin fires. Currently GestureProvider fires a GPB when a scale gesture is detected. It can instead fire a GPB whenever a multi-finger interaction is detected. Not sure how breaking this could be for other users of GPB/GPE.

In particular, a single GSB/GBE can now contain multiple GPB/GPE sequences. And we have to be careful when to fire GPEs.

Option B: Let TouchActionFilter locally treat a multi-finger gesture as a pinch-zoom. Instead of using the effect of 'touch-action: pinch-zoom' within a GPB/GPE sequence, use it whenever there is a multifinger gesture. A simpler solution would be to assume that it will be effective from the beginning of a multi-finger gesture till GSE.

Comment 3 by mustaq@chromium.org, Feb 22 2017

Blocking: 681775

Comment 4 by mustaq@chromium.org, Feb 22 2017

Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, Mar 14 2017

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

commit 16ce460b6793b9fff0c1d4cc72deab60b921a159
Author: mustaq <mustaq@chromium.org>
Date: Tue Mar 14 16:22:36 2017

Fixed two-finger pan filtering with 'touch-action: pan-x pan-y'.

For touch-action filtering, we treat a two-finger pan like a single-finger
pan. As a result, a 'touch-action: pan-x pan-y' region allows two-finger
panning but disallows pinch-zooming. This looks problematic:
- It is not easy for users to distinguish between two-finger panning vs
  pinching.
- Edge's touch-action filtering treats a two-finger pan like a pinch-zoom
  for a while.
- Popular embedded maps need to distinguish between two-finger vs
  one-finger gestures through touch-action, where a two-finger gestures
  is used to manipulate the map while a one-finger gesture is handled by
  the browser. Here is a mock:
    http://mustaqahmed.github.io/web/image-panning.html

This CL filters a two-finger pan like a pinch-zoom to solve this problem.

In addition to solving the bug, this CL also simplified the touch-action
filtering code around panning/zooming.

BUG= 632525 

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

[modify] https://crrev.com/16ce460b6793b9fff0c1d4cc72deab60b921a159/content/browser/renderer_host/input/touch_action_filter.cc
[modify] https://crrev.com/16ce460b6793b9fff0c1d4cc72deab60b921a159/content/browser/renderer_host/input/touch_action_filter.h
[modify] https://crrev.com/16ce460b6793b9fff0c1d4cc72deab60b921a159/content/browser/renderer_host/input/touch_action_filter_unittest.cc
[modify] https://crrev.com/16ce460b6793b9fff0c1d4cc72deab60b921a159/content/common/input/synthetic_web_input_event_builders.cc
[modify] https://crrev.com/16ce460b6793b9fff0c1d4cc72deab60b921a159/content/common/input/synthetic_web_input_event_builders.h

Comment 6 by mustaq@chromium.org, Mar 14 2017

Status: Fixed (was: Started)
Project Member

Comment 7 by bugdroid1@chromium.org, Mar 14 2017

Comment 8 by rbyers@chromium.org, Mar 27 2017

Labels: M-59

Sign in to add a comment