[Qt][WK2] API tests randomly asserts in QQuickWebPage::setContentsScale(qreal)
authorostapenko.viatcheslav@nokia.com <ostapenko.viatcheslav@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jul 2012 15:34:54 +0000 (15:34 +0000)
committerostapenko.viatcheslav@nokia.com <ostapenko.viatcheslav@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jul 2012 15:34:54 +0000 (15:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=88679

Reviewed by Csaba Osztrogonác.

Viewport parameters cannot be calculated while viewport is not visible and
viewport size is 0, so let's delay calculation of viewport parameters until view
becomes visible.

* UIProcess/qt/QtViewportHandler.cpp:
(WebKit::QtViewportHandler::pageContentsSizeChanged):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/qt/QtViewportHandler.cpp

index d41d9fa..1d32a9d 100644 (file)
@@ -1,3 +1,17 @@
+2012-07-03  Viatcheslav Ostapenko  <ostapenko.viatcheslav@nokia.com>
+
+        [Qt][WK2] API tests randomly asserts in QQuickWebPage::setContentsScale(qreal)
+        https://bugs.webkit.org/show_bug.cgi?id=88679
+
+        Reviewed by Csaba Osztrogonác.
+
+        Viewport parameters cannot be calculated while viewport is not visible and 
+        viewport size is 0, so let's delay calculation of viewport parameters until view 
+        becomes visible.
+
+        * UIProcess/qt/QtViewportHandler.cpp:
+        (WebKit::QtViewportHandler::pageContentsSizeChanged):
+
 2012-07-03  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
 
         [Qt] Make use of .qmake.cache for caching features
index 548819e..a1f56d1 100644 (file)
@@ -238,6 +238,9 @@ void QtViewportHandler::viewportAttributesChanged(const WebCore::ViewportAttribu
 
 void QtViewportHandler::pageContentsSizeChanged(const QSize& newSize, const QSize& viewportSize)
 {
+    if (viewportSize.isEmpty())
+        return;
+
     float minimumScale = WebCore::computeMinimumScaleFactorForContentContained(m_rawAttributes, viewportSize, newSize);
 
     if (!qFuzzyCompare(minimumScale, m_rawAttributes.minimumScale)) {