Changeset 140869 in webkit


Ignore:
Timestamp:
Jan 25, 2013, 3:02:26 PM (12 years ago)
Author:
aelias@chromium.org
Message:

Call FrameView::contentsResized() when setting fixed layout size
https://bugs.webkit.org/show_bug.cgi?id=107922

Reviewed by James Robinson.

In fixed layout mode, we should be calling contentsResized() when the
fixed layout size is changed; on the other hand, we don't need to layout
when the visible contents size changes.

This fixes test WebFrameTest::FixedLayoutInitializeAtMinimumPageScale.

Source/WebCore:

  • page/FrameView.cpp:

(WebCore::FrameView::visibleContentsResized):

  • platform/ScrollView.cpp:

(WebCore::ScrollView::setFixedLayoutSize):
(WebCore::ScrollView::setUseFixedLayout):

Source/WebKit/chromium:

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::resize):
(WebKit::WebViewImpl::computePageScaleFactorLimits):

  • tests/WebFrameTest.cpp:
Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140867 r140869  
     12013-01-25  Alexandre Elias  <aelias@chromium.org>
     2
     3        Call FrameView::contentsResized() when setting fixed layout size
     4        https://bugs.webkit.org/show_bug.cgi?id=107922
     5
     6        Reviewed by James Robinson.
     7
     8        In fixed layout mode, we should be calling contentsResized() when the
     9        fixed layout size is changed; on the other hand, we don't need to layout
     10        when the visible contents size changes.
     11
     12        This fixes test WebFrameTest::FixedLayoutInitializeAtMinimumPageScale.
     13
     14        * page/FrameView.cpp:
     15        (WebCore::FrameView::visibleContentsResized):
     16        * platform/ScrollView.cpp:
     17        (WebCore::ScrollView::setFixedLayoutSize):
     18        (WebCore::ScrollView::setUseFixedLayout):
     19
    1202013-01-25  Tony Gentilcore  <tonyg@chromium.org>
    221
  • trunk/Source/WebCore/page/FrameView.cpp

    r140571 r140869  
    20232023        return;
    20242024
    2025     if (needsLayout())
     2025    if (!useFixedLayout() && needsLayout())
    20262026        layout();
    20272027
  • trunk/Source/WebCore/platform/ScrollView.cpp

    r140571 r140869  
    278278    m_fixedLayoutSize = newSize;
    279279    updateScrollbars(scrollOffset());
     280    if (m_useFixedLayout)
     281        contentsResized();
    280282}
    281283
     
    291293    m_useFixedLayout = enable;
    292294    updateScrollbars(scrollOffset());
     295    contentsResized();
    293296}
    294297
  • trunk/Source/WebKit/chromium/ChangeLog

    r140850 r140869  
     12013-01-25  Alexandre Elias  <aelias@chromium.org>
     2
     3        Call FrameView::contentsResized() when setting fixed layout size
     4        https://bugs.webkit.org/show_bug.cgi?id=107922
     5
     6        Reviewed by James Robinson.
     7
     8        In fixed layout mode, we should be calling contentsResized() when the
     9        fixed layout size is changed; on the other hand, we don't need to layout
     10        when the visible contents size changes.
     11
     12        This fixes test WebFrameTest::FixedLayoutInitializeAtMinimumPageScale.
     13
     14        * src/WebViewImpl.cpp:
     15        (WebKit::WebViewImpl::resize):
     16        (WebKit::WebViewImpl::computePageScaleFactorLimits):
     17        * tests/WebFrameTest.cpp:
     18
    1192013-01-25  Alec Flett  <alecflett@chromium.org>
    220
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r140808 r140869  
    16521652#if ENABLE(VIEWPORT)
    16531653    if (settings()->viewportEnabled()) {
    1654         if (!settingsImpl()->applyPageScaleFactorInCompositor()) {
    1655             // Relayout immediately to obtain the new content width, which is needed
    1656             // to calculate the minimum scale limit.
    1657             view->layout();
    1658         }
    16591654        computePageScaleFactorLimits();
    16601655
     
    30893084    FrameView* view = page()->mainFrame()->view();
    30903085
     3086    // Layout to refresh to the latest contents width.
     3087    if (view->needsLayout())
     3088        view->layout();
     3089
    30913090    m_minimumPageScaleFactor = min(max(m_pageDefinedMinimumPageScaleFactor, minPageScaleFactor), maxPageScaleFactor);
    30923091    m_maximumPageScaleFactor = max(min(m_pageDefinedMaximumPageScaleFactor, maxPageScaleFactor), minPageScaleFactor);
  • trunk/Source/WebKit/chromium/tests/WebFrameTest.cpp

    r140076 r140869  
    239239    WebView* webView = static_cast<WebView*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "no_viewport_tag.html", true, 0, &client));
    240240
     241    webView->settings()->setApplyDeviceScaleFactorInCompositor(true);
     242    webView->settings()->setApplyPageScaleFactorInCompositor(true);
    241243    webView->settings()->setViewportEnabled(true);
    242244    webView->enableFixedLayoutMode(true);
     
    246248    EXPECT_EQ(2, webView->deviceScaleFactor());
    247249
    248     // Device scale factor should be a component of page scale factor in fixed-layout, so a scale of 1 becomes 2.
     250    // Page scale factor should not be affected by device scale factor.
    249251    webView->setPageScaleFactorLimits(1, 2);
    250     EXPECT_EQ(2, webView->pageScaleFactor());
     252    EXPECT_EQ(1, webView->pageScaleFactor());
    251253
    252254    // Force the layout to happen before leaving the test.
     
    254256}
    255257
    256 // Test is disabled because it started failing after r140025.
    257 // See bug for details: webkit.org/b/107206.
    258 TEST_F(WebFrameTest, DISABLED_FixedLayoutInitializeAtMinimumPageScale)
     258TEST_F(WebFrameTest, FixedLayoutInitializeAtMinimumPageScale)
    259259{
    260260    registerMockedHttpURLLoad("fixed_layout.html");
     
    268268    // only becomes available after the load begins.
    269269    WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client));
     270    webViewImpl->settings()->setApplyDeviceScaleFactorInCompositor(true);
     271    webViewImpl->settings()->setApplyPageScaleFactorInCompositor(true);
    270272    webViewImpl->enableFixedLayoutMode(true);
    271273    webViewImpl->settings()->setViewportEnabled(true);
Note: See TracChangeset for help on using the changeset viewer.