Title: [130692] trunk/Source
- Revision
- 130692
- Author
- [email protected]
- Date
- 2012-10-08 15:15:44 -0700 (Mon, 08 Oct 2012)
Log 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 <[email protected]> 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.
Modified Paths
Added Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (130691 => 130692)
--- trunk/Source/WebCore/ChangeLog 2012-10-08 22:07:19 UTC (rev 130691)
+++ trunk/Source/WebCore/ChangeLog 2012-10-08 22:15:44 UTC (rev 130692)
@@ -1,3 +1,20 @@
+2012-10-08 Sami Kyostila <[email protected]>
+
+ Some non-scrollable elements are added to non-fast-scrollable region
+ https://bugs.webkit.org/show_bug.cgi?id=97927
+
+ Reviewed by James Robinson.
+
+ 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):
+
2012-10-08 Simon Fraser <[email protected]>
Move layerTreeAsText to window.internals
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (130691 => 130692)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2012-10-08 22:07:19 UTC (rev 130691)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2012-10-08 22:15:44 UTC (rev 130692)
@@ -2629,7 +2629,7 @@
m_vBar->setProportion(clientHeight, m_scrollSize.height());
}
- updateScrollableAreaSet((hasHorizontalOverflow || hasVerticalOverflow) && scrollsOverflow());
+ updateScrollableAreaSet((hasHorizontalOverflow || hasVerticalOverflow) && scrollsOverflow() && allowsScrolling());
}
void RenderLayer::updateScrollInfoAfterLayout()
@@ -4847,7 +4847,7 @@
}
if (!m_scrollDimensionsDirty)
- updateScrollableAreaSet((hasHorizontalOverflow() || hasVerticalOverflow()) && scrollsOverflow());
+ updateScrollableAreaSet((hasHorizontalOverflow() || hasVerticalOverflow()) && scrollsOverflow() && allowsScrolling());
}
void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle)
Modified: trunk/Source/WebKit/chromium/ChangeLog (130691 => 130692)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-10-08 22:07:19 UTC (rev 130691)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-10-08 22:15:44 UTC (rev 130692)
@@ -1,3 +1,30 @@
+2012-10-08 Sami Kyostila <[email protected]>
+
+ Some non-scrollable elements are added to non-fast-scrollable region
+ https://bugs.webkit.org/show_bug.cgi?id=97927
+
+ Reviewed by James Robinson.
+
+ 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.
+
2012-10-08 Sailesh Agrawal <[email protected]>
Mac Chromium: Ignore system numpad modifier
Modified: trunk/Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp (130691 => 130692)
--- trunk/Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp 2012-10-08 22:07:19 UTC (rev 130691)
+++ trunk/Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp 2012-10-08 22:15:44 UTC (rev 130692)
@@ -183,6 +183,15 @@
ASSERT_TRUE(rootScrollLayer->haveWheelEventHandlers());
}
+TEST_F(ScrollingCoordinatorChromiumTest, clippedBodyTest)
+{
+ registerMockedHttpURLLoad("clipped-body.html");
+ navigateTo(m_baseURL + "clipped-body.html");
+
+ WebLayer* rootScrollLayer = getRootScrollLayer();
+ ASSERT_EQ(0u, rootScrollLayer->nonFastScrollableRegion().size());
+}
+
#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
TEST_F(ScrollingCoordinatorChromiumTest, touchOverflowScrolling)
{
Added: trunk/Source/WebKit/chromium/tests/data/clipped-body.html (0 => 130692)
--- trunk/Source/WebKit/chromium/tests/data/clipped-body.html (rev 0)
+++ trunk/Source/WebKit/chromium/tests/data/clipped-body.html 2012-10-08 22:15:44 UTC (rev 130692)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+ <style>
+ html, body {
+ overflow-x: hidden;
+ }
+ #content {
+ background: silver;
+ width: 1000px;
+ height: 1000px;
+ }
+ </style>
+<head>
+
+<body>
+ <div id="content"></div>
+</body>
+
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes