Title: [129890] trunk/Source/WebKit2
Revision
129890
Author
kbal...@webkit.org
Date
2012-09-28 06:55:52 -0700 (Fri, 28 Sep 2012)

Log Message

[Qt] QRawWebView tests are broke after r129545
https://bugs.webkit.org/show_bug.cgi?id=97907

Reviewed by Noam Rosenthal.

The issue here is that we set up the page loader client before initializing the page
so the message we send in WebPageProxy::initializeLoaderClient will be lost since the
page does not exists at the web process side yet. The trivial fix would be to reorder
initialization. In this patch I also moved to the new model of observing layout changes
via WKPageDidLayoutCallback since the old one will be deprecated at some time.

* UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp:
(WebView::WebView):
(WebView::didLayout):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (129889 => 129890)


--- trunk/Source/WebKit2/ChangeLog	2012-09-28 13:52:18 UTC (rev 129889)
+++ trunk/Source/WebKit2/ChangeLog	2012-09-28 13:55:52 UTC (rev 129890)
@@ -1,3 +1,20 @@
+2012-09-28  Balazs Kelemen  <kbal...@webkit.org>
+
+        [Qt] QRawWebView tests are broke after r129545
+        https://bugs.webkit.org/show_bug.cgi?id=97907
+
+        Reviewed by Noam Rosenthal.
+
+        The issue here is that we set up the page loader client before initializing the page
+        so the message we send in WebPageProxy::initializeLoaderClient will be lost since the
+        page does not exists at the web process side yet. The trivial fix would be to reorder
+        initialization. In this patch I also moved to the new model of observing layout changes
+        via WKPageDidLayoutCallback since the old one will be deprecated at some time.
+
+        * UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp:
+        (WebView::WebView):
+        (WebView::didLayout):
+
 2012-09-28  Gyuyoung Kim  <gyuyoung....@samsung.com>
 
         Unreviewed, rolling out r129863.

Modified: trunk/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp (129889 => 129890)


--- trunk/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp	2012-09-28 13:52:18 UTC (rev 129889)
+++ trunk/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp	2012-09-28 13:55:52 UTC (rev 129890)
@@ -27,6 +27,7 @@
 
 #include <WebKit2/WKContext.h>
 #include <WebKit2/WKPageGroup.h>
+#include <WebKit2/WKPageLoadTypes.h>
 #include <WebKit2/WKPreferences.h>
 #include <WebKit2/WKPreferencesPrivate.h>
 #include <WebKit2/WKStringQt.h>
@@ -60,15 +61,18 @@
 public:
     WebView(const QSize& size, bool transparent = false)
     {
+        m_webView = new QRawWebView(webContext(), webPageGroup(QString()), this);
+        m_webView->setTransparentBackground(transparent);
+        m_webView->create();
+
         WKPageLoaderClient loaderClient;
         memset(&loaderClient, 0, sizeof(WKPageLoaderClient));
+        loaderClient.version = kWKPageLoaderClientCurrentVersion;
         loaderClient.clientInfo = this;
-        loaderClient.didFirstVisuallyNonEmptyLayoutForFrame = WebView::finishFirstLayoutForFrame;
+        loaderClient.didLayout = WebView::didLayout;
 
-        m_webView = new QRawWebView(webContext(), webPageGroup(QString()), this);
         WKPageSetPageLoaderClient(m_webView->pageRef(), &loaderClient);
-        m_webView->setTransparentBackground(transparent);
-        m_webView->create();
+        WKPageListenForLayoutMilestones(m_webView->pageRef(), kWKDidFirstVisuallyNonEmptyLayout);
         WKPageSetUseFixedLayout(m_webView->pageRef(), true);
 
         m_webView->setSize(size);
@@ -118,7 +122,7 @@
         static_cast<WebView*>(context)->onRepaintDone();
     }
 
-    static void finishFirstLayoutForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+    static void didLayout(WKPageRef page, WKLayoutMilestones milestones, WKTypeRef userData, const void *clientInfo)
     {
         static_cast<WebView*>(const_cast<void*>(clientInfo))->frameLoaded();
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to