Allow wheel listeners in an OOPIF to see and preventDefault wheel events from a trackpad pinch |
|||||
Issue descriptionChrome Version: 61.0.3148.0 OS: Mac What steps will reproduce the problem? (1) Visit a page with a cross site iframe (e.g. http://csreis.github.io/tests/cross-site-iframe.html ) (2) Add a wheel listener within the iframe that calls preventDefault on the wheel events. For example: document.body.addEventListener('wheel', function(e) { e.preventDefault(); }); (3) Use the trackpad to pinch zoom with the mouse cursor over the element with the listener. What is the expected result? The listener should see the wheel events from the pinch and preventDefault should prevent the browser from zooming. What happens instead? The listener does not see the wheel events and the browser zooms. For a practical example, the custom pinch zoom implementation for google maps does not work when in an OOPIF. The main frame is scaled instead.
,
Oct 2 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/78f31b1960395f3fc7aff4cdbf7335f82553f9d9 commit 78f31b1960395f3fc7aff4cdbf7335f82553f9d9 Author: W. James MacLean <wjmaclean@chromium.org> Date: Mon Oct 02 21:16:36 2017 Route GesturePinch events from RenderWidgetHostViewMac. If we route the GesturePinch events sent from RenderWidgetHostViewMac, then wheel event listeners in OOPIF subframes, and the PDF viewer, can intercept the pinch events in order to implement native pinch zoom behaviour. Bug: 739213 Change-Id: I50db39ef53a988b491b3b7e79fa66a392e86c9b7 Reviewed-on: https://chromium-review.googlesource.com/559650 Commit-Queue: James MacLean <wjmaclean@chromium.org> Reviewed-by: Charlie Reis <creis@chromium.org> Reviewed-by: Ken Buchanan <kenrb@chromium.org> Cr-Commit-Position: refs/heads/master@{#505784} [modify] https://crrev.com/78f31b1960395f3fc7aff4cdbf7335f82553f9d9/content/browser/renderer_host/render_widget_host_input_event_router.h [modify] https://crrev.com/78f31b1960395f3fc7aff4cdbf7335f82553f9d9/content/browser/renderer_host/render_widget_host_view_mac.h [modify] https://crrev.com/78f31b1960395f3fc7aff4cdbf7335f82553f9d9/content/browser/renderer_host/render_widget_host_view_mac.mm [modify] https://crrev.com/78f31b1960395f3fc7aff4cdbf7335f82553f9d9/content/browser/site_per_process_browsertest.cc [modify] https://crrev.com/78f31b1960395f3fc7aff4cdbf7335f82553f9d9/content/browser/site_per_process_mac_browsertest.mm [modify] https://crrev.com/78f31b1960395f3fc7aff4cdbf7335f82553f9d9/content/test/BUILD.gn
,
Oct 12 2017
,
Nov 17 2017
mcnee@: Is there more work to do here, or can this bug be marked fixed after r505784? (I notice that this is listed as blocking 715662, which is already marked fixed.)
,
Nov 18 2017
James's CL was enough to unblock work on 715662, but there is more to do here. The current state of things is that when a user pinches with a Mac trackpad over a guest, we run js wheel handlers. However in the general OOPIF case, we don't run them yet, since the code for this needs to be moved out of WebViewImpl.cpp. Also, if the pinch is not consumed in the child, we do not yet apply the scale change to the main frame. I have a CL that fixes these remaining issues, but it's not quite ready for review.
,
Nov 22 2017
,
Jun 5 2018
As of https://chromium.googlesource.com/chromium/src/+/297980d7a0e33b44dce6c727d7016345a80e33fa , touchpad pinch over an OOPIF has the correct behaviour.
,
Aug 2
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by wjmaclean@chromium.org
, Jul 5 2017