Bug 64373

Summary: [Qt][WK2] Add a basic pinch gesture recognizer for WebKit2.
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: WebKit2Assignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: jturcotte, kling, tonikitoo
Priority: P2 Keywords: Qt, QtTriaged
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch kling: review+, kling: commit-queue-

Description Benjamin Poulain 2011-07-12 11:13:40 PDT
Jocelyn needs pinch zoom for testing. Let's add something simple to get him started :)
Comment 1 Benjamin Poulain 2011-07-12 11:26:58 PDT
Created attachment 100528 [details]
Patch
Comment 2 Andreas Kling 2011-07-12 11:51:29 PDT
Comment on attachment 100528 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=100528&action=review

r=me with some itches.

> Source/WebKit2/UIProcess/qt/QtPinchGestureRecognizer.cpp:68
> +    case QEvent::TouchBegin:
> +    case QEvent::TouchUpdate:

Would be neat with a comment here explaining that the ultimate plan is to only initiate the gesture upon TouchBegin.

> Source/WebKit2/UIProcess/qt/QtPinchGestureRecognizer.h:42
> +const qreal pinchInitialTriggerDistanceThreshold = 5.;

Why not put this in the cpp file?

> Source/WebKit2/UIProcess/qt/TouchViewInterface.cpp:34
> +    , m_pinchStartScale(1.f)

Coding style, unnecessary .f suffix.

> Source/WebKit2/UIProcess/qt/TouchViewInterface.cpp:69
> +void TouchViewInterface::pinchGestureRequestScale(const QPointF& pinchCenterInPageViewCoordinate, qreal totalScaleFactor)

The name of this function is a bit weird. setScaleFromPinchGesture() perhaps?

> Source/WebKit2/UIProcess/qt/TouchViewInterface.h:44
> +    void pinchGestureStarted();
> +    void pinchGestureRequestScale(const QPointF&, qreal);
> +    void pinchGestureEnded();

I would have used did* style naming for these.
Comment 3 Andreas Kling 2011-07-12 11:52:09 PDT
Comment on attachment 100528 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=100528&action=review

> Source/WebKit2/ChangeLog:3
> +        [Qt][WK2] Add a basic Pinch gesture recognizer for WebKit 2

WebKit 2 -> WebKit2 ;D
Comment 4 Benjamin Poulain 2011-07-12 12:16:38 PDT
Committed r90838: <http://trac.webkit.org/changeset/90838>