Chrome PDF viewer should pinch-zoom when using a Mac touchpad. |
|||||||
Issue descriptionThe browser responds to the pinch-zoom gesture when using a Mac touchpad. We should implement this in the PDF viewer along with the touch pinch-zoom.
,
Apr 28 2017
So we currently are only able to listen to the raw touch events in javascript and not the higher level gesture events. With the Mac touchpad, we have gesture events that don't originate from touch events, so we can't handle the events ourselves. Here's an idea of how we could implement this: 1) Extend ppapi to handle gesture events 2) In OutOfProcessInstance::HandleInputEvent, indicate that we've handled the gesture pinch events so that native pinch-zoom is prevented 3) PostMessage the gesture event information to the page so that gesture_detector.js can see it and pass it on to its listeners to invoke our custom pinch-zoom
,
Apr 28 2017
Mac trackpad pinch generates a sequence of MouseWheel events. These exist primarily to provide a way for JS to disable trackpad pinch if desired, but they do carry information about pinch scale. Assuming we can find a way to differentiate them from trackpad scroll (the pinch wheels all have the control modifier set, may this is enough), then we can unpack the information about the intended scale and use that to provide pinch. Of course, GesturePinchX events never make it into the WebView, so we'd have to be sure that the mouse-wheels propagate properly to the WebView for this to work.
,
May 1 2017
It looks like the pdf viewer does not see the wheel events from a touchpad pinch, although it does see the wheel events from a touchpad scroll.
,
May 1 2017
Correct ... only the "parent" will see those wheels ... and I guess we don't forward them to the guest either. I suppose we could imagine adding JS to the page that embeds the WV to do something reasonable, like post-messaging the wheels through, though not sure if that would (1) be acceptable to the Blink folks, or (2) have security implications.
,
May 2 2017
,
Jun 22 2017
,
Sep 26 2017
Issue 767501 has been merged into this issue.
,
Oct 12 2017
,
Oct 17 2017
,
Oct 20 2017
,
Nov 13 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bc61eb6a67219aa4352a4767d62d5b46719ca03e commit bc61eb6a67219aa4352a4767d62d5b46719ca03e Author: Kevin McNee <mcnee@chromium.org> Date: Mon Nov 13 20:39:14 2017 PDF viewer: Handle ctrl-wheel zooming with the viewer's pinch zoom mechanism. When pinch zooming with a Mac trackpad, we generate synthetic ctrl-wheels so that JS can handle the gesture. We now use these wheel events in the PDF viewer's gesture detector to create pinch events for the viewer's pinch zoom mechanism, as we currently do for pinches from touch events. We also use this for non-synthetic ctrl-wheels. This allows us to have zooming with the mouse wheel anchor the zoom around the mouse position instead of the scroll position. Bug: 715662 , 715670 Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation Change-Id: Ia672a266cdd69c3e87d1451548c7470176ed8fd6 Reviewed-on: https://chromium-review.googlesource.com/730648 Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Commit-Queue: Kevin McNee <mcnee@chromium.org> Cr-Commit-Position: refs/heads/master@{#516034} [modify] https://crrev.com/bc61eb6a67219aa4352a4767d62d5b46719ca03e/chrome/browser/pdf/pdf_extension_test.cc [modify] https://crrev.com/bc61eb6a67219aa4352a4767d62d5b46719ca03e/chrome/browser/resources/pdf/gesture_detector.js [modify] https://crrev.com/bc61eb6a67219aa4352a4767d62d5b46719ca03e/chrome/test/data/pdf/gesture_detector_test.js [modify] https://crrev.com/bc61eb6a67219aa4352a4767d62d5b46719ca03e/content/public/test/browser_test_utils.cc [modify] https://crrev.com/bc61eb6a67219aa4352a4767d62d5b46719ca03e/content/public/test/browser_test_utils.h
,
Nov 14 2017
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by kpreid@google.com
, Apr 26 2017