The macOS double-tap gesture cannot be prevented |
|||||
Issue descriptionChrome Version: 63.0.3239.84 (Official Build) (64-bit) OS: macOS Sierra 10.12.6 What steps will reproduce the problem? (1) Use a MacBook with a trackpad (2) Enable the "Smart zoom" feature in the trackpad page of System Preferences (see https://apple.stackexchange.com/a/107952/51809 for where it is) (3) Create a page with the '<meta name="viewport" content="minimum-scale=1, maximum-scale=1, user-scalable=no">' tag and 'touch-action: none;' on every element (4) Open the page and double-tap with two fingers on the trackpad What is the expected result? Double-tapping should not cause the page to zoom. What happens instead? Double-tapping causes the page to zoom. The web platform is for both documents and for applications. This gesture makes sense for documents but doesn't make sense for applications. In particular, our app Figma is an in-browser design tool used by professional designers. It has its own notion of zoom so users don't think of the browser being able to zoom on the UI. We get repeated reports of user confusion when users accidentally double-tap and get into this state. It's particularly bad for us because we have no way of detecting that this has happened and the browser doesn't make it at all obvious what has happened or how to undo it. From the user's point of view, our app just looks permanently broken for them. Suggestion for an easy fix: respect "user-scalable=no" and/or "touch-action: none".
,
Jan 18 2018
Ah, that's a good point, we definitely should provide some way to disable that. As for the suggestions - "user-scalable=no" won't work since viewport meta tags aren't parsed on desktop. touch-action: none could work but it's semantically meant for touchscreens. We already provide a mechanism to block trackpad-based pinch zoom: sending a 'mousewheel' event before the zoom starts that can be preventDefaulted to block zoom. I think it'd make sense to extend this to cover trackpad based double-tap-to-zoom as well.
,
Jan 18 2018
That solution sounds great! As long as there's some way to do it :)
,
Jun 22 2018
mcnee@ has done work in this area recently. Could you take a stab at this? I suspect you know where all the relevant bits are and this should be a rather quick fix. I notice this on Maps sometimes and it's a negative UX that sites can't work around.
,
Jun 22 2018
Yeah, offering a synthetic wheel seems like the most suitable mechanism. How do we want the event to appear to the page? If we send the event with a scale of 1.0, then existing sites that implement their own touchpad pinch zoom will prevent the smart zoom, and then since the scale is 1.0, the page's custom zoom shouldn't do anything. Does this seem reasonable? As an aside, I introduced a hack to disable smart zoom for the PDF viewer ( crbug.com/676668 ). It'll be nice to get rid of that.
,
Jun 23 2018
Yup, sgtm! Thanks!
,
Sep 19
,
Sep 24
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9d6c082819b3d4238a58ffbe5849247b19599520 commit 9d6c082819b3d4238a58ffbe5849247b19599520 Author: Kevin McNee <mcnee@chromium.org> Date: Mon Sep 24 16:22:00 2018 Small cleanup for double-tap to zoom on desktop We update/remove comments that claim that double-tap to zoom is specific to Android. We also enable double-tap to zoom on Mac via WebPreferences rather than hardcoding it as always enabled. Bug: 802369 Change-Id: Ib78a0a85f295166bff3363ed65dceca9e5e3468e Reviewed-on: https://chromium-review.googlesource.com/1235129 Reviewed-by: David Bokan <bokan@chromium.org> Reviewed-by: Rick Byers <rbyers@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Kevin McNee <mcnee@chromium.org> Cr-Commit-Position: refs/heads/master@{#593557} [modify] https://crrev.com/9d6c082819b3d4238a58ffbe5849247b19599520/content/public/common/web_preferences.cc [modify] https://crrev.com/9d6c082819b3d4238a58ffbe5849247b19599520/content/public/common/web_preferences.h [modify] https://crrev.com/9d6c082819b3d4238a58ffbe5849247b19599520/content/renderer/render_view_impl.cc [modify] https://crrev.com/9d6c082819b3d4238a58ffbe5849247b19599520/third_party/blink/public/platform/web_input_event.h [modify] https://crrev.com/9d6c082819b3d4238a58ffbe5849247b19599520/third_party/blink/renderer/core/exported/web_view_impl.cc
,
Oct 12
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1a7d30967b85d822537c58ae86fc8e17d123b530 commit 1a7d30967b85d822537c58ae86fc8e17d123b530 Author: Kevin McNee <mcnee@chromium.org> Date: Fri Oct 12 15:30:46 2018 Offer a synthetic wheel event for double-tap to zoom on a touchpad Currently, a web page receives synthetic wheel events for touchpad pinch so that it may prevent the browser from changing the page scale and instead implement custom zoom behaviour. On Mac, in addition to the pinch gesture, a double-tap with two fingers on a touchpad causes a scale change. There is currently no way for a page to prevent this. Now, before applying a scale change from a touchpad double-tap, we offer a synthetic wheel to the page which it may cancel. Bug: 802369 Change-Id: Idc68c7d0992fa7bd2bdf29bf3357085276821434 Reviewed-on: https://chromium-review.googlesource.com/c/1237234 Reviewed-by: Ken Buchanan <kenrb@chromium.org> Reviewed-by: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Rick Byers <rbyers@chromium.org> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Commit-Queue: Kevin McNee <mcnee@chromium.org> Cr-Commit-Position: refs/heads/master@{#599226} [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/frame_host/cross_process_frame_connector.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/frame_host/cross_process_frame_connector.h [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/frame_host/render_widget_host_view_guest.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/frame_host/render_widget_host_view_guest.h [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/frame_connector_delegate.h [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/input/input_router_impl.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/input/input_router_impl_unittest.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/input/touchpad_pinch_browsertest.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/input/touchpad_pinch_event_queue.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/input/touchpad_pinch_event_queue_unittest.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/input/web_input_event_builders_mac.mm [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/render_widget_host_input_event_router.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/render_widget_host_input_event_router.h [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/render_widget_host_view_android.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/render_widget_host_view_aura.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/render_widget_host_view_base.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/render_widget_host_view_base.h [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/render_widget_host_view_child_frame.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/render_widget_host_view_child_frame.h [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/render_widget_host_view_mac.h [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/render_widget_host_view_mac.mm [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/browser/site_per_process_hit_test_browsertest.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/common/input/input_event_struct_traits.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/content/common/input/synthetic_web_input_event_builders.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/third_party/blink/public/platform/web_gesture_event.h [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/third_party/blink/renderer/core/input/mouse_wheel_event_manager.cc [modify] https://crrev.com/1a7d30967b85d822537c58ae86fc8e17d123b530/ui/events/blink/blink_event_util.cc
,
Oct 15
,
Oct 16
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6ce83ed8a96c2a8e96931ce84c785837c1b9e7ee commit 6ce83ed8a96c2a8e96931ce84c785837c1b9e7ee Author: Kevin McNee <mcnee@chromium.org> Date: Tue Oct 16 14:38:30 2018 Remove hack to disable double-tap to zoom gesture for PDF viewer This effectively reverts https://chromium-review.googlesource.com/c/chromium/src/+/614084 which added this hack. This is no longer necessary as wheel listeners can now prevent the double-tap to zoom gesture (see issue 802369 ) and the PDF viewer has the necessary behaviour already (see testPreventNativeZoomFromWheel in gesture_detector_test.js). Bug: 676668 , 802369 Change-Id: I4cb840d9f383c0f8aa4a47851d749de41004816b Reviewed-on: https://chromium-review.googlesource.com/c/1281172 Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Kevin McNee <mcnee@chromium.org> Cr-Commit-Position: refs/heads/master@{#599975} [modify] https://crrev.com/6ce83ed8a96c2a8e96931ce84c785837c1b9e7ee/chrome/browser/pdf/pdf_extension_test.cc [modify] https://crrev.com/6ce83ed8a96c2a8e96931ce84c785837c1b9e7ee/chrome/browser/ui/browser.cc
,
Oct 18
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cccd8b081ba6273a8ec5db88b6a7e428396d61fd commit cccd8b081ba6273a8ec5db88b6a7e428396d61fd Author: Kevin McNee <mcnee@chromium.org> Date: Thu Oct 18 16:10:01 2018 Update callers of WebGestureEvent::NeedsWheelEvent I previously made the DCHECK in WebGestureEvent::NeedsWheelEvent more strict, but overlooked these callers. Here we update these remaining callers so that they won't hit the DCHECK. Bug: 787924 , 802369 Change-Id: I65ae2dc873b25d0a3d770f2581a278b06ce7e7d8 Reviewed-on: https://chromium-review.googlesource.com/c/1286767 Reviewed-by: James MacLean <wjmaclean@chromium.org> Reviewed-by: Ben Wells <benwells@chromium.org> Commit-Queue: Kevin McNee <mcnee@chromium.org> Cr-Commit-Position: refs/heads/master@{#600782} [modify] https://crrev.com/cccd8b081ba6273a8ec5db88b6a7e428396d61fd/components/guest_view/browser/guest_view_base.cc [modify] https://crrev.com/cccd8b081ba6273a8ec5db88b6a7e428396d61fd/extensions/browser/app_window/app_web_contents_helper.cc |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dtapu...@chromium.org
, Jan 16 2018