Title: [136851] trunk/Source/WebKit2
Revision
136851
Author
[email protected]
Date
2012-12-06 09:53:26 -0800 (Thu, 06 Dec 2012)

Log Message

[Qt][WK2] Fix QWebKitTest's notification of device pixel ratio change
https://bugs.webkit.org/show_bug.cgi?id=104269

Reviewed by Kenneth Rohde Christiansen.

Since the ViewportInfoItem of MiniBrowser is created before the
WebView finishes construction, thus before the viewport controller
has been instantiated, the shown device pixel ratio was incorrect.
Additionally QWebKitTest's notification signal was also not emitted
when the value changed.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::QQuickWebViewPrivate):
* UIProcess/qt/PageViewportControllerClientQt.cpp:
(WebKit::PageViewportControllerClientQt::PageViewportControllerClientQt):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (136850 => 136851)


--- trunk/Source/WebKit2/ChangeLog	2012-12-06 17:52:50 UTC (rev 136850)
+++ trunk/Source/WebKit2/ChangeLog	2012-12-06 17:53:26 UTC (rev 136851)
@@ -1,3 +1,21 @@
+2012-12-06  Andras Becsi  <[email protected]>
+
+        [Qt][WK2] Fix QWebKitTest's notification of device pixel ratio change
+        https://bugs.webkit.org/show_bug.cgi?id=104269
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Since the ViewportInfoItem of MiniBrowser is created before the
+        WebView finishes construction, thus before the viewport controller
+        has been instantiated, the shown device pixel ratio was incorrect.
+        Additionally QWebKitTest's notification signal was also not emitted
+        when the value changed.
+
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebViewPrivate::QQuickWebViewPrivate):
+        * UIProcess/qt/PageViewportControllerClientQt.cpp:
+        (WebKit::PageViewportControllerClientQt::PageViewportControllerClientQt):
+
 2012-12-06  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r136788.

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


--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2012-12-06 17:52:50 UTC (rev 136850)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2012-12-06 17:53:26 UTC (rev 136851)
@@ -280,6 +280,7 @@
     viewport->setPixelAligned(true);
     QObject::connect(viewport, SIGNAL(visibleChanged()), viewport, SLOT(_q_onVisibleChanged()));
     QObject::connect(viewport, SIGNAL(urlChanged()), viewport, SLOT(_q_onUrlChanged()));
+    QObject::connect(experimental, SIGNAL(devicePixelRatioChanged()), experimental->test(), SIGNAL(devicePixelRatioChanged()));
     pageView.reset(new QQuickWebPage(viewport));
 }
 

Modified: trunk/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp (136850 => 136851)


--- trunk/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp	2012-12-06 17:52:50 UTC (rev 136850)
+++ trunk/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp	2012-12-06 17:53:26 UTC (rev 136851)
@@ -59,6 +59,11 @@
 
     connect(m_scaleAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)),
             SLOT(scaleAnimationStateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+
+    // Notify about device pixel ratio here because due to the delayed instantiation
+    // of the viewport controller the correct value might not have reached QWebKitTest
+    // in time it was used from QML.
+    emit m_viewportItem->experimental()->test()->devicePixelRatioChanged();
 }
 
 void PageViewportControllerClientQt::ScaleAnimation::updateCurrentValue(const QVariant& value)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to