Title: [147909] trunk/Source/WebKit2
Revision
147909
Author
[email protected]
Date
2013-04-08 04:13:20 -0700 (Mon, 08 Apr 2013)

Log Message

[Qt][WK2] WebView's interactive property is not fully respected
https://bugs.webkit.org/show_bug.cgi?id=113066

Reviewed by Jocelyn Turcotte.

WK2 sign-off by Benjamin Poulain.

The QML WebView inherits the "interactive" property from Flickable
which is true by default, and disables the interaction with the
Flickable if set to false.
Resulting from the design of the WebView panning and flicking is
disabled by Flickable but to be consistent we also need to disable
double-tap gestures and pinch gestures since they would trigger
scale and position changes.

* UIProcess/qt/PageViewportControllerClientQt.cpp:
(WebKit::PageViewportControllerClientQt::pinchGestureStarted):
(WebKit::PageViewportControllerClientQt::pinchGestureRequestUpdate):
(WebKit::PageViewportControllerClientQt::pinchGestureEnded):
* UIProcess/qt/QtWebPageEventHandler.cpp:
(WebKit::QtWebPageEventHandler::handleDoubleTapEvent):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (147908 => 147909)


--- trunk/Source/WebKit2/ChangeLog	2013-04-08 10:32:59 UTC (rev 147908)
+++ trunk/Source/WebKit2/ChangeLog	2013-04-08 11:13:20 UTC (rev 147909)
@@ -1,3 +1,27 @@
+2013-04-08  Andras Becsi  <[email protected]>
+
+        [Qt][WK2] WebView's interactive property is not fully respected
+        https://bugs.webkit.org/show_bug.cgi?id=113066
+
+        Reviewed by Jocelyn Turcotte.
+
+        WK2 sign-off by Benjamin Poulain.
+
+        The QML WebView inherits the "interactive" property from Flickable
+        which is true by default, and disables the interaction with the
+        Flickable if set to false.
+        Resulting from the design of the WebView panning and flicking is
+        disabled by Flickable but to be consistent we also need to disable
+        double-tap gestures and pinch gestures since they would trigger
+        scale and position changes.
+
+        * UIProcess/qt/PageViewportControllerClientQt.cpp:
+        (WebKit::PageViewportControllerClientQt::pinchGestureStarted):
+        (WebKit::PageViewportControllerClientQt::pinchGestureRequestUpdate):
+        (WebKit::PageViewportControllerClientQt::pinchGestureEnded):
+        * UIProcess/qt/QtWebPageEventHandler.cpp:
+        (WebKit::QtWebPageEventHandler::handleDoubleTapEvent):
+
 2013-04-07  David Kilzer  <[email protected]>
 
         Remove the rest of SVG_DOM_OBJC_BINDINGS

Modified: trunk/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp (147908 => 147909)


--- trunk/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp	2013-04-08 10:32:59 UTC (rev 147908)
+++ trunk/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp	2013-04-08 11:13:20 UTC (rev 147909)
@@ -430,7 +430,7 @@
     // This can only happen as a result of a user interaction.
     ASSERT(m_touchInteraction.inProgress());
 
-    if (!m_controller->allowsUserScaling())
+    if (!m_controller->allowsUserScaling() || !m_viewportItem->isInteractive())
         return;
 
     clearRelativeZoomState();
@@ -442,11 +442,10 @@
 
 void PageViewportControllerClientQt::pinchGestureRequestUpdate(const QPointF& pinchCenterInViewportCoordinates, qreal totalScaleFactor)
 {
-    ASSERT(m_scaleChange.inProgress());
-
-    if (!m_controller->allowsUserScaling())
+    if (!m_controller->allowsUserScaling() || !m_viewportItem->isInteractive())
         return;
 
+    ASSERT(m_scaleChange.inProgress());
     ASSERT(m_pinchStartScale > 0);
     //  Changes of the center position should move the page even if the zoom factor does not change.
     const qreal pinchScale = m_pinchStartScale * totalScaleFactor;
@@ -464,11 +463,10 @@
 
 void PageViewportControllerClientQt::pinchGestureEnded()
 {
-    ASSERT(m_scaleChange.inProgress());
-
-    if (!m_controller->allowsUserScaling())
+    if (m_pinchStartScale < 0)
         return;
 
+    ASSERT(m_scaleChange.inProgress());
     m_pinchStartScale = -1;
 
     // This will take care of resuming the content, even if no animation was performed.

Modified: trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp (147908 => 147909)


--- trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp	2013-04-08 10:32:59 UTC (rev 147908)
+++ trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp	2013-04-08 11:13:20 UTC (rev 147909)
@@ -271,6 +271,9 @@
 
 void QtWebPageEventHandler::handleDoubleTapEvent(const QTouchEvent::TouchPoint& point)
 {
+    if (!m_webView->isInteractive())
+        return;
+
     deactivateTapHighlight();
     QTransform fromItemTransform = m_webPage->transformFromItem();
     m_webPageProxy->findZoomableAreaForPoint(fromItemTransform.map(point.pos()).toPoint(), IntSize(point.rect().size().toSize()));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to