summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2013-04-08 15:50:02 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-08 18:27:01 +0200
commita878703f1652ba6e541b81cb19d5a7d3e842aadc (patch)
tree4a0ae4ee117687351d3bce75ecc3964ff3496256 /Source/WebKit2/UIProcess
parent2acba686f82ba55fca8fa0ea383e6e1f46d34524 (diff)
downloadqtwebkit-a878703f1652ba6e541b81cb19d5a7d3e842aadc.tar.gz
[Qt][WK2] WebView's interactive property is not fully respected
https://bugs.webkit.org/show_bug.cgi?id=113066 https://trac.webkit.org/r147909 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. Change-Id: I7879d7fa4bd2ccaf711dc44012905d49c9d7e8fd Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'Source/WebKit2/UIProcess')
-rw-r--r--Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp12
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp3
2 files changed, 8 insertions, 7 deletions
diff --git a/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp b/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp
index 61f2aaf57..6351555cf 100644
--- a/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp
+++ b/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp
@@ -449,7 +449,7 @@ void PageViewportControllerClientQt::pinchGestureStarted(const QPointF& pinchCen
// This can only happen as a result of a user interaction.
ASSERT(m_controller->hadUserInteraction());
- if (!m_controller->allowsUserScaling())
+ if (!m_controller->allowsUserScaling() || !m_viewportItem->isInteractive())
return;
clearRelativeZoomState();
@@ -461,11 +461,10 @@ void PageViewportControllerClientQt::pinchGestureStarted(const QPointF& pinchCen
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;
@@ -483,11 +482,10 @@ void PageViewportControllerClientQt::pinchGestureRequestUpdate(const QPointF& pi
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.
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
index 93f759f60..8176ed1cd 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
@@ -271,6 +271,9 @@ void QtWebPageEventHandler::handleSingleTapEvent(const QTouchEvent::TouchPoint&
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()));