Some non-scrollable elements are added to non-fast-scrollable region
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Oct 2012 22:15:44 +0000 (22:15 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Oct 2012 22:15:44 +0000 (22:15 +0000)
commit4f7e8b75a726e93634d5cdd82c06241d0e12dac5
tree40e378787e0907322b0b17d7e91d1b2bc562616b
parent21d9db5cde6022ffe79ffe2e0a7f4687ab6fa027
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130692 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp
Source/WebKit/chromium/tests/data/clipped-body.html [new file with mode: 0644]