Commit 57823749 authored by chrishtr's avatar chrishtr Committed by Commit bot

Don't apply composited scrolling offsets if composited scrolling isn't happening.

BUG=646363
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2343963002
Cr-Commit-Position: refs/heads/master@{#418965}
parent cbf3eb05
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x300
LayoutBlockFlow {HTML} at (0,0) size 800x300
LayoutBlockFlow {BODY} at (0,0) size 800x300
layer at (0,0) size 800x300 scrollY 50.00 scrollWidth 1000 scrollHeight 1050 layerType: background only
layer at (0,950) size 800x0
LayoutBlockFlow (relative positioned) zI: -1 {DIV} at (0,1000) size 800x0
layer at (0,0) size 800x300 scrollY 50.00 scrollWidth 1000 scrollHeight 1050 layerType: foreground only
LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 800x300 [bgcolor=#808080]
layer at (0,0) size 1000x1000 backgroundClip at (0,0) size 800x300 clip at (0,0) size 800x300
LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 1000x1000 [bgcolor=#FFFFFF]
<!doctype HTML>
<style>
body {
margin: 0;
}
::-webkit-scrollbar {
display: none;
}
#scroller {
background: gray;
height: 300px;
overflow: scroll;
position: relative;
z-index: 0;
}
#content {
overflow: hidden;
position: relative;
background-color: white;
width: 1000px;
height: 1000px;
top: 50px;
}
</style>
<!-- The test succeeds if white is visible across all of the visible scrolling area, and no gray -->
<div id="scroller">
<div id="content"></div>
<div style="position: relative; z-index: -1; will-change: transform"></div>
</div>
<script>
onload = function() {
scroller.scrollTop = 50;
}
</script>
......@@ -2434,10 +2434,12 @@ void CompositedLayerMapping::adjustForCompositedScrolling(const GraphicsLayer* g
{
if (graphicsLayer == m_scrollingContentsLayer.get() || graphicsLayer == m_foregroundLayer.get()) {
if (PaintLayerScrollableArea* scrollableArea = m_owningLayer.getScrollableArea()) {
// Note: this is just the scroll offset, *not* the "adjusted scroll offset". Scroll offset
// does not include the origin adjustment. That is instead baked already into offsetFromLayoutObject.
DoubleSize scrollOffset = scrollableArea->scrollOffset();
offset.expand(-scrollOffset.width(), -scrollOffset.height());
if (scrollableArea->usesCompositedScrolling()) {
// Note: this is just the scroll offset, *not* the "adjusted scroll offset". Scroll offset
// does not include the origin adjustment. That is instead baked already into offsetFromLayoutObject.
DoubleSize scrollOffset = scrollableArea->scrollOffset();
offset.expand(-scrollOffset.width(), -scrollOffset.height());
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment