Title: [122318] trunk/Source/WebKit2
Revision
122318
Author
abe...@webkit.org
Date
2012-07-11 02:40:23 -0700 (Wed, 11 Jul 2012)

Log Message

[Qt][WK2] ASSERT: "!m_viewportItem->isMoving()" in QtViewportHandler::flickMoveEnded()
https://bugs.webkit.org/show_bug.cgi?id=90875

Reviewed by Kenneth Rohde Christiansen.

Since MultiPointTouchArea and PinchArea use the childMouseEventFilter
method to filter touch events too, and because Flickable filters child
mouse events the canvas calls this function before propagating the touch
event to the WebView. Since Flickable does not accept touch events the
canvas tries to propagate a synthesized mouse event through the base
class childMouseEventFilter function which is accepted by Flickable and
interferes with the input events we send to Flicakble hence messes up
the internal state of the WebView.
This patch reimplements the virtual childMouseEventFilter method so that all
the mouse and touch events can be processed by WebKit before they arrive to
Flickable.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebView::childMouseEventFilter):
* UIProcess/API/qt/qquickwebview_p.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (122317 => 122318)


--- trunk/Source/WebKit2/ChangeLog	2012-07-11 09:28:06 UTC (rev 122317)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-11 09:40:23 UTC (rev 122318)
@@ -1,3 +1,26 @@
+2012-07-11  Andras Becsi  <andras.be...@nokia.com>
+
+        [Qt][WK2] ASSERT: "!m_viewportItem->isMoving()" in QtViewportHandler::flickMoveEnded()
+        https://bugs.webkit.org/show_bug.cgi?id=90875
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Since MultiPointTouchArea and PinchArea use the childMouseEventFilter
+        method to filter touch events too, and because Flickable filters child
+        mouse events the canvas calls this function before propagating the touch
+        event to the WebView. Since Flickable does not accept touch events the
+        canvas tries to propagate a synthesized mouse event through the base
+        class childMouseEventFilter function which is accepted by Flickable and
+        interferes with the input events we send to Flicakble hence messes up
+        the internal state of the WebView.
+        This patch reimplements the virtual childMouseEventFilter method so that all
+        the mouse and touch events can be processed by WebKit before they arrive to
+        Flickable.
+
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebView::childMouseEventFilter):
+        * UIProcess/API/qt/qquickwebview_p.h:
+
 2012-07-10  Christophe Dumez  <christophe.du...@intel.com>
 
         [WK2][EFL] Add Battery Status Provider

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp (122317 => 122318)


--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2012-07-11 09:28:06 UTC (rev 122317)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2012-07-11 09:40:23 UTC (rev 122318)
@@ -1655,6 +1655,38 @@
     WTF::initializeMainThread();
 }
 
+bool QQuickWebView::childMouseEventFilter(QQuickItem* item, QEvent* event)
+{
+    // This function is used by MultiPointTouchArea and PinchArea to filter
+    // touch events, thus to hinder the canvas from sending synthesized
+    // mouse events to the Flickable implementation we need to reimplement
+    // childMouseEventFilter and filter incoming touch events as well.
+
+    if (!isVisible() || !isEnabled())
+        return QQuickFlickable::childMouseEventFilter(item, event);
+
+    switch (event->type()) {
+    case QEvent::MouseButtonPress:
+        mousePressEvent(static_cast<QMouseEvent*>(event));
+        return event->isAccepted();
+    case QEvent::MouseMove:
+        mouseMoveEvent(static_cast<QMouseEvent*>(event));
+        return event->isAccepted();
+    case QEvent::MouseButtonRelease:
+        mouseReleaseEvent(static_cast<QMouseEvent*>(event));
+        return event->isAccepted();
+    case QEvent::TouchBegin:
+    case QEvent::TouchUpdate:
+    case QEvent::TouchEnd:
+        touchEvent(static_cast<QTouchEvent*>(event));
+        return event->isAccepted();
+    default:
+        break;
+    }
+
+    return QQuickFlickable::childMouseEventFilter(item, event);
+}
+
 void QQuickWebView::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
 {
     Q_D(QQuickWebView);

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h (122317 => 122318)


--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h	2012-07-11 09:28:06 UTC (rev 122317)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h	2012-07-11 09:40:23 UTC (rev 122318)
@@ -168,6 +168,7 @@
     void navigationRequested(QWebNavigationRequest* request);
 
 protected:
+    virtual bool childMouseEventFilter(QQuickItem*, QEvent*);
     virtual void geometryChanged(const QRectF&, const QRectF&);
     virtual void componentComplete();
     virtual void keyPressEvent(QKeyEvent*);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to