[Qt] Fix the tst_QQuickWebView::scrollRequest auto test
authorjocelyn.turcotte@digia.com <jocelyn.turcotte@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Oct 2012 10:43:49 +0000 (10:43 +0000)
committerjocelyn.turcotte@digia.com <jocelyn.turcotte@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Oct 2012 10:43:49 +0000 (10:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=98045

Reviewed by Simon Hausmann.

Relying on QQuickWebViewPrivate::setNeedsDisplay can cause a false positive
emission of the loadVisuallyCommitted signal since this method is also
called when a layer is deleted or when the root layer changes.

Move the signal emission to QQuickWebViewPrivate::didRenderFrame which
is called only after a DidRenderFrame message has been received from the
web process.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::setNeedsDisplay):
(QQuickWebViewPrivate::didRenderFrame):
* UIProcess/API/qt/qquickwebview_p_p.h:
(QQuickWebViewPrivate):
* UIProcess/qt/QtPageClient.cpp:
(WebKit::QtPageClient::didRenderFrame):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130382 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
Source/WebKit2/UIProcess/qt/QtPageClient.cpp

index 3766ed8..bc9c30f 100644 (file)
@@ -1,3 +1,26 @@
+2012-10-04  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
+
+        [Qt] Fix the tst_QQuickWebView::scrollRequest auto test
+        https://bugs.webkit.org/show_bug.cgi?id=98045
+
+        Reviewed by Simon Hausmann.
+
+        Relying on QQuickWebViewPrivate::setNeedsDisplay can cause a false positive
+        emission of the loadVisuallyCommitted signal since this method is also
+        called when a layer is deleted or when the root layer changes.
+
+        Move the signal emission to QQuickWebViewPrivate::didRenderFrame which
+        is called only after a DidRenderFrame message has been received from the
+        web process.
+
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebViewPrivate::setNeedsDisplay):
+        (QQuickWebViewPrivate::didRenderFrame):
+        * UIProcess/API/qt/qquickwebview_p_p.h:
+        (QQuickWebViewPrivate):
+        * UIProcess/qt/QtPageClient.cpp:
+        (WebKit::QtPageClient::didRenderFrame):
+
 2012-10-04  Christophe Dumez  <christophe.dumez@intel.com>
 
         Regression(r130363): Broke unit tests
index 55ca46a..3387ce3 100644 (file)
@@ -454,12 +454,16 @@ void QQuickWebViewPrivate::setNeedsDisplay()
         q->page()->d->paint(&painter);
         return;
     }
+    q->page()->update();
+}
 
+void QQuickWebViewPrivate::didRenderFrame()
+{
+    Q_Q(QQuickWebView);
     if (m_betweenLoadCommitAndFirstFrame) {
         emit q->experimental()->loadVisuallyCommitted();
         m_betweenLoadCommitAndFirstFrame = false;
     }
-    q->page()->update();
 }
 
 void QQuickWebViewPrivate::processDidCrash()
index b18fe90..65a51fc 100644 (file)
@@ -88,6 +88,7 @@ public:
 
     int loadProgress() const { return m_loadProgress; }
     void setNeedsDisplay();
+    void didRenderFrame();
 
     WebKit::PageViewportController* viewportController() const { return m_pageViewportController.data(); }
     virtual void updateViewportSize() { }
index bea8a2c..e000134 100644 (file)
@@ -75,7 +75,10 @@ void QtPageClient::setViewNeedsDisplay(const WebCore::IntRect& rect)
 
 void QtPageClient::didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect)
 {
+    // The viewport has to be notified first so that the viewport position
+    // is adjusted before the loadVisuallyCommitted() signal.
     QQuickWebViewPrivate::get(m_webView)->viewportController()->didRenderFrame(contentsSize, coveredRect);
+    QQuickWebViewPrivate::get(m_webView)->didRenderFrame();
 }
 
 void QtPageClient::pageDidRequestScroll(const IntPoint& pos)