Title: [141483] trunk/Source/WebKit/chromium
Revision
141483
Author
[email protected]
Date
2013-01-31 14:02:23 -0800 (Thu, 31 Jan 2013)

Log Message

[chromium] Rework page scale factor limits initialization
https://bugs.webkit.org/show_bug.cgi?id=108446

Reviewed by James Robinson.

When loading a page with viewportEnabled, both the limits
specified by the viewport tag and the content width need to be
considered before we initialize the minimum page scale (and
pageScaleFactor itself usually to the same value). The timing has
proven tricky to get correct.

This patch simplifies the flow by computing the
limits only at the end of layouts and at no other time. In combination
with https://bugs.webkit.org/show_bug.cgi?id=107922 which sets
needsLayout() appropriately, this results in a more robust and easy
to understand sequence.

Fixes FixedLayoutInitializeAtMinimumPageScale test.

* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::resize):
(WebKit::WebViewImpl::setPageScaleFactorLimits):
(WebKit::WebViewImpl::computePageScaleFactorLimits):
(WebKit::WebViewImpl::layoutUpdated):
(WebKit::WebViewImpl::didChangeContentsSize):
* src/WebViewImpl.h:
(WebKit::WebViewImpl::setInitialPageScaleFactor):
(WebViewImpl):
* tests/WebFrameTest.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (141482 => 141483)


--- trunk/Source/WebKit/chromium/ChangeLog	2013-01-31 22:00:22 UTC (rev 141482)
+++ trunk/Source/WebKit/chromium/ChangeLog	2013-01-31 22:02:23 UTC (rev 141483)
@@ -1,3 +1,38 @@
+2013-01-31  Alexandre Elias  <[email protected]>
+
+        [chromium] Rework page scale factor limits initialization
+        https://bugs.webkit.org/show_bug.cgi?id=108446
+
+        Reviewed by James Robinson.
+
+        When loading a page with viewportEnabled, both the limits
+        specified by the viewport tag and the content width need to be
+        considered before we initialize the minimum page scale (and
+        pageScaleFactor itself usually to the same value). The timing has
+        proven tricky to get correct.
+
+        This patch simplifies the flow by computing the
+        limits only at the end of layouts and at no other time. In combination
+        with https://bugs.webkit.org/show_bug.cgi?id=107922 which sets
+        needsLayout() appropriately, this results in a more robust and easy
+        to understand sequence.
+
+        Fixes FixedLayoutInitializeAtMinimumPageScale test.
+
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::WebViewImpl):
+        (WebKit::WebViewImpl::resize):
+        (WebKit::WebViewImpl::setPageScaleFactorLimits):
+        (WebKit::WebViewImpl::computePageScaleFactorLimits):
+        (WebKit::WebViewImpl::layoutUpdated):
+        (WebKit::WebViewImpl::didChangeContentsSize):
+        * src/WebViewImpl.h:
+        (WebKit::WebViewImpl::setInitialPageScaleFactor):
+        (WebViewImpl):
+        * tests/WebFrameTest.cpp:
+
 2013-01-31  Aurimas Liutikas  <[email protected]>
 
         Editor::m_compositionNode not updated on HTMLInputElement::setValue()

Modified: trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp (141482 => 141483)


--- trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp	2013-01-31 22:00:22 UTC (rev 141482)
+++ trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp	2013-01-31 22:02:23 UTC (rev 141483)
@@ -669,12 +669,10 @@
     if (!m_webView->settingsImpl()->applyDeviceScaleFactorInCompositor())
         computed.initialScale *= deviceScaleFactor;
 
-    bool needInitializePageScale = !m_webView->isPageScaleFactorSet();
+    m_webView->setInitialPageScaleFactor(computed.initialScale);
     m_webView->setFixedLayoutSize(flooredIntSize(computed.layoutSize));
     m_webView->setDeviceScaleFactor(deviceScaleFactor);
     m_webView->setPageScaleFactorLimits(computed.minimumScale, computed.maximumScale);
-    if (needInitializePageScale)
-        m_webView->setPageScaleFactorPreservingScrollOffset(computed.initialScale);
 #endif
 }
 

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (141482 => 141483)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2013-01-31 22:00:22 UTC (rev 141482)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2013-01-31 22:02:23 UTC (rev 141483)
@@ -396,6 +396,7 @@
     , m_pageDefinedMaximumPageScaleFactor(-1)
     , m_minimumPageScaleFactor(minPageScaleFactor)
     , m_maximumPageScaleFactor(maxPageScaleFactor)
+    , m_initialPageScaleFactor(-1)
     , m_ignoreViewportTagMaximumScale(false)
     , m_pageScaleFactorIsSet(false)
     , m_savedPageScaleFactor(0)
@@ -1660,10 +1661,9 @@
 
 #if ENABLE(VIEWPORT)
     if (settings()->viewportEnabled()) {
-        // Relayout immediately to obtain the new content width, which is needed
-        // to calculate the minimum scale limit.
-        view->layout();
-        computePageScaleFactorLimits();
+        // Relayout immediately to recalculate the minimum scale limit.
+        if (view->needsLayout())
+            view->layout();
 
         // When the device rotates:
         // - If the page width is unchanged, then zoom by new width/old width
@@ -3047,9 +3047,22 @@
 
 void WebViewImpl::setPageScaleFactorLimits(float minPageScale, float maxPageScale)
 {
+    if (minPageScale == m_pageDefinedMinimumPageScaleFactor && maxPageScale == m_pageDefinedMaximumPageScaleFactor)
+        return;
+
     m_pageDefinedMinimumPageScaleFactor = minPageScale;
     m_pageDefinedMaximumPageScaleFactor = maxPageScale;
-    computePageScaleFactorLimits();
+
+    if (settings()->viewportEnabled()) {
+        // If we're in viewport tag mode, we need to layout to obtain the latest
+        // contents size and compute the final limits.
+        FrameView* view = mainFrameImpl()->frameView();
+        if (view)
+            view->setNeedsLayout();
+    } else {
+        // Otherwise just compute the limits immediately.
+        computePageScaleFactorLimits();
+    }
 }
 
 void WebViewImpl::setIgnoreViewportTagMaximumScale(bool flag)
@@ -3092,45 +3105,46 @@
     return IntSize(contentSize.width(), contentSize.width() * aspectRatio);
 }
 
-bool WebViewImpl::computePageScaleFactorLimits()
+void WebViewImpl::computePageScaleFactorLimits()
 {
     if (m_pageDefinedMinimumPageScaleFactor == -1 || m_pageDefinedMaximumPageScaleFactor == -1)
-        return false;
+        return;
 
     if (!mainFrame() || !page() || !page()->mainFrame() || !page()->mainFrame()->view())
-        return false;
+        return;
 
     FrameView* view = page()->mainFrame()->view();
 
     m_minimumPageScaleFactor = min(max(m_pageDefinedMinimumPageScaleFactor, minPageScaleFactor), maxPageScaleFactor);
     m_maximumPageScaleFactor = max(min(m_pageDefinedMaximumPageScaleFactor, maxPageScaleFactor), minPageScaleFactor);
-    if (!m_webSettings->applyDeviceScaleFactorInCompositor()) {
-        m_minimumPageScaleFactor *= deviceScaleFactor();
-        m_maximumPageScaleFactor *= deviceScaleFactor();
-    }
 
-    int viewWidthNotIncludingScrollbars = m_size.width;
-    if (viewWidthNotIncludingScrollbars && view->verticalScrollbar() && !view->verticalScrollbar()->isOverlayScrollbar())
-        viewWidthNotIncludingScrollbars -= view->verticalScrollbar()->width();
-    int unscaledContentsWidth = contentsSize().width();
-    if (viewWidthNotIncludingScrollbars && unscaledContentsWidth) {
-        // Limit page scaling down to the document width.
-        m_minimumPageScaleFactor = max(m_minimumPageScaleFactor, static_cast<float>(viewWidthNotIncludingScrollbars) / unscaledContentsWidth);
+    if (settings()->viewportEnabled()) {
+        if (!contentsSize().width() || !m_size.width)
+            return;
+
+        // When viewport tag is enabled, the scale needed to see the full
+        // content width is the default minimum.
+        int viewWidthNotIncludingScrollbars = m_size.width;
+        if (view->verticalScrollbar() && !view->verticalScrollbar()->isOverlayScrollbar())
+            viewWidthNotIncludingScrollbars -= view->verticalScrollbar()->width();
+        m_minimumPageScaleFactor = max(m_minimumPageScaleFactor, static_cast<float>(viewWidthNotIncludingScrollbars) / contentsSize().width());
         m_maximumPageScaleFactor = max(m_minimumPageScaleFactor, m_maximumPageScaleFactor);
     }
     ASSERT(m_minimumPageScaleFactor <= m_maximumPageScaleFactor);
 
-    float clampedScale = clampPageScaleFactorToLimits(pageScaleFactor());
+    // Initialize and/or clamp the page scale factor if needed.
+    float newPageScaleFactor = pageScaleFactor();
+    if (!m_pageScaleFactorIsSet && m_initialPageScaleFactor != -1) {
+        newPageScaleFactor = m_initialPageScaleFactor;
+        m_pageScaleFactorIsSet = true;
+    }
+    newPageScaleFactor = clampPageScaleFactorToLimits(newPageScaleFactor);
 #if USE(ACCELERATED_COMPOSITING)
     if (m_layerTreeView)
-        m_layerTreeView->setPageScaleFactorAndLimits(clampedScale, m_minimumPageScaleFactor, m_maximumPageScaleFactor);
+        m_layerTreeView->setPageScaleFactorAndLimits(newPageScaleFactor, m_minimumPageScaleFactor, m_maximumPageScaleFactor);
 #endif
-    if (clampedScale != pageScaleFactor()) {
-        setPageScaleFactorPreservingScrollOffset(clampedScale);
-        return true;
-    }
-
-    return false;
+    if (newPageScaleFactor != pageScaleFactor())
+        setPageScaleFactorPreservingScrollOffset(newPageScaleFactor);
 }
 
 float WebViewImpl::minimumPageScaleFactor() const
@@ -3742,32 +3756,31 @@
         }
     }
 
+    if (settings()->viewportEnabled()) {
+        if (!isPageScaleFactorSet()) {
+            // If the viewport tag failed to be processed earlier, we need
+            // to recompute it now.
+            ViewportArguments viewportArguments = mainFrameImpl()->frame()->document()->viewportArguments();
+            m_page->chrome()->client()->dispatchViewportPropertiesDidChange(viewportArguments);
+        }
+
+        // Contents size is an input to the page scale limits, so a good time to
+        // recalculate is after layout has occurred.
+        computePageScaleFactorLimits();
+
+        // Relayout immediately to avoid violating the rule that needsLayout()
+        // isn't set at the end of a layout.
+        FrameView* view = mainFrameImpl()->frameView();
+        if (view && view->needsLayout())
+            view->layout();
+    }
+
     m_client->didUpdateLayout();
+
 }
 
 void WebViewImpl::didChangeContentsSize()
 {
-#if ENABLE(VIEWPORT)
-    if (!settings()->viewportEnabled() || !mainFrameImpl())
-        return;
-
-    bool mayNeedLayout = false;
-    if (!isPageScaleFactorSet()) {
-        // If the viewport tag failed to be processed earlier, we need
-        // to recompute it now.
-        ViewportArguments viewportArguments = mainFrameImpl()->frame()->document()->viewportArguments();
-        m_page->chrome()->client()->dispatchViewportPropertiesDidChange(viewportArguments);
-        mayNeedLayout = true;
-    } else
-        mayNeedLayout = computePageScaleFactorLimits();
-
-    // didChangeContentsSize() may be called from FrameView::layout; we need to
-    // relayout to avoid triggering the assertion that needsLayout() isn't set
-    // at the end of a layout.
-    FrameView* view = mainFrameImpl()->frameView();
-    if (mayNeedLayout && view && view->needsLayout())
-        view->layout();
-#endif
 }
 
 bool WebViewImpl::useExternalPopupMenus()

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (141482 => 141483)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.h	2013-01-31 22:00:22 UTC (rev 141482)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h	2013-01-31 22:02:23 UTC (rev 141483)
@@ -481,6 +481,7 @@
         return m_emulatedTextZoomFactor;
     }
 
+    void setInitialPageScaleFactor(float initialPageScaleFactor) { m_initialPageScaleFactor = initialPageScaleFactor; }
     bool ignoreViewportTagMaximumScale() const { return m_ignoreViewportTagMaximumScale; }
 
     // Determines whether a page should e.g. be opened in a background tab.
@@ -612,7 +613,7 @@
     WebSettingsImpl* settingsImpl();
 
 private:
-    bool computePageScaleFactorLimits();
+    void computePageScaleFactorLimits();
     float clampPageScaleFactorToLimits(float scale);
     WebCore::IntPoint clampOffsetAtScale(const WebCore::IntPoint& offset, float scale) const;
     WebCore::IntSize contentsSize() const;
@@ -752,6 +753,7 @@
     float m_pageDefinedMaximumPageScaleFactor;
     float m_minimumPageScaleFactor;
     float m_maximumPageScaleFactor;
+    float m_initialPageScaleFactor;
     bool m_ignoreViewportTagMaximumScale;
     bool m_pageScaleFactorIsSet;
 

Modified: trunk/Source/WebKit/chromium/tests/WebFrameTest.cpp (141482 => 141483)


--- trunk/Source/WebKit/chromium/tests/WebFrameTest.cpp	2013-01-31 22:00:22 UTC (rev 141482)
+++ trunk/Source/WebKit/chromium/tests/WebFrameTest.cpp	2013-01-31 22:02:23 UTC (rev 141483)
@@ -286,9 +286,7 @@
     webView->mainFrame()->contentAsText(1024).utf8();
 }
 
-// Test is disabled because it started failing after r140025.
-// See bug for details: webkit.org/b/107206.
-TEST_F(WebFrameTest, DISABLED_FixedLayoutInitializeAtMinimumPageScale)
+TEST_F(WebFrameTest, FixedLayoutInitializeAtMinimumPageScale)
 {
     registerMockedHttpURLLoad("fixed_layout.html");
 
@@ -300,6 +298,8 @@
     // Make sure we initialize to minimum scale, even if the window size
     // only becomes available after the load begins.
     WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client));
+    webViewImpl->settings()->setApplyDeviceScaleFactorInCompositor(true);
+    webViewImpl->settings()->setApplyPageScaleFactorInCompositor(true);
     webViewImpl->enableFixedLayoutMode(true);
     webViewImpl->settings()->setViewportEnabled(true);
     webViewImpl->resize(WebSize(viewportWidth, viewportHeight));
@@ -387,8 +387,7 @@
     EXPECT_EQ(3, webViewImpl->pageScaleFactor());
 }
 
-// Disabled, pending investigation after http://trac.webkit.org/changeset/141053
-TEST_F(WebFrameTest, DISABLED_pageScaleFactorShrinksViewport)
+TEST_F(WebFrameTest, pageScaleFactorShrinksViewport)
 {
     registerMockedHttpURLLoad("fixed_layout.html");
 
@@ -396,8 +395,6 @@
     client.m_screenInfo.deviceScaleFactor = 1;
     int viewportWidth = 640;
     int viewportHeight = 480;
-    int viewportWidthMinusScrollbar = 640 - 15;
-    int viewportHeightMinusScrollbar = 480 - 15;
 
     WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client));
     webViewImpl->settings()->setApplyDeviceScaleFactorInCompositor(true);
@@ -407,17 +404,21 @@
     webViewImpl->resize(WebSize(viewportWidth, viewportHeight));
     webViewImpl->layout();
 
+    WebCore::FrameView* view = webViewImpl->mainFrameImpl()->frameView();
+    int viewportWidthMinusScrollbar = 640 - (view->verticalScrollbar()->isOverlayScrollbar() ? 0 : 15);
+    int viewportHeightMinusScrollbar = 480 - (view->horizontalScrollbar()->isOverlayScrollbar() ? 0 : 15);
+
     webViewImpl->setPageScaleFactor(2, WebPoint());
 
-    WebCore::IntSize unscaledSize = webViewImpl->mainFrameImpl()->frameView()->unscaledVisibleContentSize(true);
+    WebCore::IntSize unscaledSize = view->unscaledVisibleContentSize(true);
     EXPECT_EQ(viewportWidth, unscaledSize.width());
     EXPECT_EQ(viewportHeight, unscaledSize.height());
 
-    WebCore::IntSize unscaledSizeMinusScrollbar = webViewImpl->mainFrameImpl()->frameView()->unscaledVisibleContentSize(false);
+    WebCore::IntSize unscaledSizeMinusScrollbar = view->unscaledVisibleContentSize(false);
     EXPECT_EQ(viewportWidthMinusScrollbar, unscaledSizeMinusScrollbar.width());
     EXPECT_EQ(viewportHeightMinusScrollbar, unscaledSizeMinusScrollbar.height());
 
-    WebCore::IntSize scaledSize = webViewImpl->mainFrameImpl()->frameView()->visibleContentRect().size();
+    WebCore::IntSize scaledSize = view->visibleContentRect().size();
     EXPECT_EQ(ceil(viewportWidthMinusScrollbar / 2.0), scaledSize.width());
     EXPECT_EQ(ceil(viewportHeightMinusScrollbar / 2.0), scaledSize.height());
 }
@@ -457,6 +458,8 @@
     int viewportHeight = 480;
 
     WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "no_scale_for_you.html", true, 0, &client));
+    webViewImpl->settings()->setApplyDeviceScaleFactorInCompositor(true);
+    webViewImpl->settings()->setApplyPageScaleFactorInCompositor(true);
     webViewImpl->enableFixedLayoutMode(true);
     webViewImpl->settings()->setViewportEnabled(true);
     webViewImpl->resize(WebSize(viewportWidth, viewportHeight));
@@ -464,6 +467,7 @@
     EXPECT_EQ(1.0f, webViewImpl->maximumPageScaleFactor());
 
     webViewImpl->setIgnoreViewportTagMaximumScale(true);
+    webViewImpl->layout();
 
     EXPECT_EQ(4.0f, webViewImpl->maximumPageScaleFactor());
 }
@@ -535,9 +539,7 @@
 
 void simulateDoubleTap(WebViewImpl* webViewImpl, WebPoint& point, float& scale)
 {
-    WebPoint scaledPoint(static_cast<int>(point.x * webViewImpl->pageScaleFactor()),
-        static_cast<int>(point.y * webViewImpl->pageScaleFactor()));
-    webViewImpl->animateZoomAroundPoint(scaledPoint, WebViewImpl::DoubleTap);
+    webViewImpl->animateZoomAroundPoint(point, WebViewImpl::DoubleTap);
     webViewImpl->mainFrameImpl()->frameView()->layout();
     scale = webViewImpl->pageScaleFactor();
 }
@@ -610,6 +612,7 @@
     // Test double tap scale bounds.
     // minimumPageScale < doubleTapZoomAlreadyLegibleScale < 1
     webView->setPageScaleFactorLimits(0.5f, 4);
+    webView->layout();
     float doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
     setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
     simulateDoubleTap(webViewImpl, doubleTapPoint, scale);
@@ -623,6 +626,7 @@
     webViewImpl->applyScrollAndScale(WebSize(), 1.1f);
     // 1 < minimumPageScale < doubleTapZoomAlreadyLegibleScale
     webView->setPageScaleFactorLimits(1.1f, 4);
+    webView->layout();
     doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
     setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
     simulateDoubleTap(webViewImpl, doubleTapPoint, scale);
@@ -636,6 +640,7 @@
     webViewImpl->applyScrollAndScale(WebSize(), 1.1f);
     // minimumPageScale < 1 < doubleTapZoomAlreadyLegibleScale
     webView->setPageScaleFactorLimits(0.95f, 4);
+    webView->layout();
     doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
     setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
     simulateDoubleTap(webViewImpl, doubleTapPoint, scale);
@@ -674,8 +679,9 @@
     // minimumPageScale < doubleTapZoomAlreadyLegibleScale < 1 < textAutosizingFontScaleFactor
     float legibleScale = textAutosizingFontScaleFactor;
     setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+    float doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
     webView->setPageScaleFactorLimits(0.5f, 4);
-    float doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
+    webView->layout();
     simulateDoubleTap(webViewImpl, doubleTapPoint, scale);
     EXPECT_FLOAT_EQ(legibleScale, scale);
     simulateDoubleTap(webViewImpl, doubleTapPoint, scale);
@@ -687,6 +693,7 @@
     webViewImpl->applyScrollAndScale(WebSize(), 1.1f);
     // 1 < textAutosizingFontScaleFactor < minimumPageScale < doubleTapZoomAlreadyLegibleScale
     webView->setPageScaleFactorLimits(1.0f, 4);
+    webView->layout();
     doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
     setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
     simulateDoubleTap(webViewImpl, doubleTapPoint, scale);
@@ -700,6 +707,7 @@
     webViewImpl->applyScrollAndScale(WebSize(), 1.1f);
     // minimumPageScale < 1 < textAutosizingFontScaleFactor < doubleTapZoomAlreadyLegibleScale
     webView->setPageScaleFactorLimits(0.95f, 4);
+    webView->layout();
     doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
     setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
     simulateDoubleTap(webViewImpl, doubleTapPoint, scale);
@@ -713,6 +721,7 @@
     webViewImpl->applyScrollAndScale(WebSize(), 1.1f);
     // minimumPageScale < 1 < doubleTapZoomAlreadyLegibleScale < textAutosizingFontScaleFactor
     webView->setPageScaleFactorLimits(0.9f, 4);
+    webView->layout();
     doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
     setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
     simulateDoubleTap(webViewImpl, doubleTapPoint, scale);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to