New issue
Advanced search Search tips

Issue 739213 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug

Blocked on:
issue 787924

Blocking:
issue 715662



Sign in to add a comment

Allow wheel listeners in an OOPIF to see and preventDefault wheel events from a trackpad pinch

Project Member Reported by mcnee@chromium.org, Jul 4 2017

Issue description

Chrome 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.
 
I've put up an initial patch for this, to run on the trybots.

https://chromium-review.googlesource.com/c/559650/

Project Member

Comment 2 by bugdroid1@chromium.org, 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

Comment 3 by mcnee@chromium.org, Oct 12 2017

Blocking: 715662

Comment 4 by creis@chromium.org, Nov 17 2017

Status: Started (was: Assigned)
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.)

Comment 5 by mcnee@chromium.org, 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.

Comment 6 by mcnee@chromium.org, Nov 22 2017

Blockedon: 787924

Comment 7 by mcnee@chromium.org, Jun 5 2018

Status: Fixed (was: Started)
As of https://chromium.googlesource.com/chromium/src/+/297980d7a0e33b44dce6c727d7016345a80e33fa , touchpad pinch over an OOPIF has the correct behaviour.
Cc: bokan@chromium.org chaopeng@chromium.org
 Issue 864246  has been merged into this issue.

Sign in to add a comment