⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 130692 in webkit


Ignore:
Timestamp:
Oct 8, 2012, 3:15:44 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

Some non-scrollable elements are added to non-fast-scrollable region
​https://bugs.webkit.org/show_bug.cgi?id=97927

Patch by Sami Kyostila <​skyostil@chromium.org> on 2012-10-08
Reviewed by James Robinson.

Source/WebCore:

Only RenderLayers that can actually be scrolled should be added to the
ScrollingCoordinator's non-fast scrollable region. Otherwise we may
needlessly fall back to main thread scrolling.

Test: ScrollingCoordinatorChromiumTest.clippedBodyTest

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::updateScrollbarsAfterLayout):
(WebCore::RenderLayer::updateScrollbarsAfterStyleChange):

Source/WebKit/chromium:

Test that a non-scrollable RenderLayer isn't added to the non-fast scrollable
region.

The test in this patch consists of a web page where both the html and
body elements clip horizontal overflow. This results in a hierarchy
where the body element gets a scrollable RenderLayer. However, that
layer isn't (interactively) scrollable because while the scroll geometry
is calculated based on the amount of overflow, the scroll bars are
hidden because of the "overflow-x: hidden" style.

Previously this layer would have made the entire page part of the
non-fast scrollable region. With this patch,
RenderLayer::allowScrolling() is used as a pre-requisite for expanding
the region, thus avoiding the problem.

  • tests/ScrollingCoordinatorChromiumTest.cpp:

(WebKit::TEST_F):
(WebKit):

  • tests/data/clipped-body.html: Added.
Location:
trunk/Source
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r130689 r130692  
     12012-10-08  Sami Kyostila  <skyostil@chromium.org>
     2
     3        Some non-scrollable elements are added to non-fast-scrollable region
     4        https://bugs.webkit.org/show_bug.cgi?id=97927
     5
     6        Reviewed by James Robinson.
     7
     8        Only RenderLayers that can actually be scrolled should be added to the
     9        ScrollingCoordinator's non-fast scrollable region. Otherwise we may
     10        needlessly fall back to main thread scrolling.
     11
     12        Test: ScrollingCoordinatorChromiumTest.clippedBodyTest
     13
     14        * rendering/RenderLayer.cpp:
     15        (WebCore::RenderLayer::updateScrollbarsAfterLayout):
     16        (WebCore::RenderLayer::updateScrollbarsAfterStyleChange):
     17
    1182012-10-08  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r130612 r130692  
    26302630    }
    26312631
    2632     updateScrollableAreaSet((hasHorizontalOverflow || hasVerticalOverflow) && scrollsOverflow());
     2632    updateScrollableAreaSet((hasHorizontalOverflow || hasVerticalOverflow) && scrollsOverflow() && allowsScrolling());
    26332633}
    26342634
    … …  
    48484848
    48494849    if (!m_scrollDimensionsDirty)
    4850         updateScrollableAreaSet((hasHorizontalOverflow() || hasVerticalOverflow()) && scrollsOverflow());
     4850        updateScrollableAreaSet((hasHorizontalOverflow() || hasVerticalOverflow()) && scrollsOverflow() && allowsScrolling());
    48514851}
    48524852
  • trunk/Source/WebKit/chromium/ChangeLog

    r130691 r130692  
     12012-10-08  Sami Kyostila  <skyostil@chromium.org>
     2
     3        Some non-scrollable elements are added to non-fast-scrollable region
     4        https://bugs.webkit.org/show_bug.cgi?id=97927
     5
     6        Reviewed by James Robinson.
     7
     8        Test that a non-scrollable RenderLayer isn't added to the non-fast scrollable
     9        region.
     10
     11        The test in this patch consists of a web page where both the html and
     12        body elements clip horizontal overflow. This results in a hierarchy
     13        where the body element gets a scrollable RenderLayer. However, that
     14        layer isn't (interactively) scrollable because while the scroll geometry
     15        is calculated based on the amount of overflow, the scroll bars are
     16        hidden because of the "overflow-x: hidden" style.
     17
     18        Previously this layer would have made the entire page part of the
     19        non-fast scrollable region. With this patch,
     20        RenderLayer::allowScrolling() is used as a pre-requisite for expanding
     21        the region, thus avoiding the problem.
     22
     23        * tests/ScrollingCoordinatorChromiumTest.cpp:
     24        (WebKit::TEST_F):
     25        (WebKit):
     26        * tests/data/clipped-body.html: Added.
     27
    1282012-10-08  Sailesh Agrawal  <sail@chromium.org>
    229
  • trunk/Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp

    r129225 r130692  
    184184}
    185185
     186TEST_F(ScrollingCoordinatorChromiumTest, clippedBodyTest)
     187{
     188    registerMockedHttpURLLoad("clipped-body.html");
     189    navigateTo(m_baseURL + "clipped-body.html");
     190
     191    WebLayer* rootScrollLayer = getRootScrollLayer();
     192    ASSERT_EQ(0u, rootScrollLayer->nonFastScrollableRegion().size());
     193}
     194
    186195#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
    187196TEST_F(ScrollingCoordinatorChromiumTest, touchOverflowScrolling)
Note: See TracChangeset for help on using the changeset viewer.