Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2126323002: Add support for touch-action: pinch-zoom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add exception for mac Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 7b29f4f93f0a2c244888bd91d1fe10c96995905f..f3691ab0d9df068f3dad7bc7368733ce2a5d264c 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -912,9 +912,6 @@ WebInputEventResult WebViewImpl::handleSyntheticWheelFromTouchpadPinchEvent(cons
{
DCHECK_EQ(pinchEvent.type, WebInputEvent::GesturePinchUpdate);
- // Touchscreen pinch events should not reach Blink.
- DCHECK_EQ(pinchEvent.sourceDevice, WebGestureDeviceTouchpad);
-
// For pinch gesture events, match typical trackpad behavior on Windows by sending fake
// wheel events with the ctrl modifier set when we see trackpad pinch gestures. Ideally
// we'd someday get a platform 'pinch' event and send that instead.
@@ -2218,14 +2215,18 @@ WebInputEventResult WebViewImpl::handleInputEvent(const WebInputEvent& inputEven
if (result != WebInputEventResult::NotHandled)
return result;
- // Unhandled touchpad gesture pinch events synthesize mouse wheel events.
+ // Unhandled pinch events should adjust the scale.
if (inputEvent.type == WebInputEvent::GesturePinchUpdate) {
const WebGestureEvent& pinchEvent = static_cast<const WebGestureEvent&>(inputEvent);
- // First, synthesize a Windows-like wheel event to send to any handlers that may exist.
- result = handleSyntheticWheelFromTouchpadPinchEvent(pinchEvent);
- if (result != WebInputEventResult::NotHandled)
- return result;
+ // For touchpad gestures synthesize a Windows-like wheel event
+ // to send to any handlers that may exist. Not necessary for touchscreen
+ // as touch events would have already been sent for the gesture.
+ if (pinchEvent.sourceDevice == WebGestureDeviceTouchpad) {
+ result = handleSyntheticWheelFromTouchpadPinchEvent(pinchEvent);
+ if (result != WebInputEventResult::NotHandled)
+ return result;
+ }
if (pinchEvent.data.pinchUpdate.zoomDisabled)
return WebInputEventResult::NotHandled;
« no previous file with comments | « third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in ('k') | third_party/WebKit/public/platform/WebInputEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698