Title: [101763] trunk/Source/WebKit2
Revision
101763
Author
[email protected]
Date
2011-12-02 01:15:18 -0800 (Fri, 02 Dec 2011)

Log Message

[Qt][WK2] ASSERT at QQuickWebViewPrivate::computeViewportConstraints() when API test is exercising zero sized views.
https://bugs.webkit.org/show_bug.cgi?id=73441

Do not assert on empty available size, but return default constrain values instead.

Patch by Zalan Bujtas <[email protected]> on 2011-12-02
Reviewed by Kenneth Rohde Christiansen.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::computeViewportConstraints):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::dispatchViewportPropertiesDidChange):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (101762 => 101763)


--- trunk/Source/WebKit2/ChangeLog	2011-12-02 09:12:58 UTC (rev 101762)
+++ trunk/Source/WebKit2/ChangeLog	2011-12-02 09:15:18 UTC (rev 101763)
@@ -1,3 +1,17 @@
+2011-12-02  Zalan Bujtas  <[email protected]>
+
+        [Qt][WK2] ASSERT at QQuickWebViewPrivate::computeViewportConstraints() when API test is exercising zero sized views.
+        https://bugs.webkit.org/show_bug.cgi?id=73441
+
+        Do not assert on empty available size, but return default constrain values instead.
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebViewPrivate::computeViewportConstraints):
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::dispatchViewportPropertiesDidChange):
+
 2011-12-01  Hajime Morrita  <[email protected]>
 
         JS_INLINE and WTF_INLINE should be visible from WebCore

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


--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2011-12-02 09:12:58 UTC (rev 101762)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2011-12-02 09:15:18 UTC (rev 101763)
@@ -205,9 +205,12 @@
 {
     Q_Q(QQuickWebView);
 
+    QtViewportInteractionEngine::Constraints newConstraints;
     QSize availableSize = q->boundingRect().size().toSize();
 
-    Q_ASSERT(!availableSize.isEmpty());
+    // Return default values for zero sized viewport.
+    if (availableSize.isEmpty())
+        return newConstraints;
 
     WebPageProxy* wkPage = toImpl(pageProxy->pageRef());
     WebPreferences* wkPrefs = wkPage->pageGroup()->preferences();
@@ -223,8 +226,6 @@
     WebCore::restrictMinimumScaleFactorToViewportSize(attr, availableSize);
     WebCore::restrictScaleFactorToInitialScaleIfNotUserScalable(attr);
 
-    QtViewportInteractionEngine::Constraints newConstraints;
-
     newConstraints.initialScale = attr.initialScale;
     newConstraints.minimumScale = attr.minimumScale;
     newConstraints.maximumScale = attr.maximumScale;

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (101762 => 101763)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2011-12-02 09:12:58 UTC (rev 101762)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2011-12-02 09:15:18 UTC (rev 101763)
@@ -735,7 +735,8 @@
 
 #if USE(TILED_BACKING_STORE)
     // When viewport properties change, recalculate and set the new recommended layout size in case of fixed layout rendering.
-    if (m_page->useFixedLayout()) {
+    // Viewport properties have no impact on zero sized fixed viewports.
+    if (m_page->useFixedLayout() && !m_page->viewportSize().isEmpty()) {
         Settings* settings = m_page->corePage()->settings();
 
         int minimumLayoutFallbackWidth = std::max(settings->layoutFallbackWidth(), m_page->viewportSize().width());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to