Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
index d7586cef31542075e0003db3c919905660465742..6349bcd7c8cc73763d625d8ce2692521f2b29b54 100644 |
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
@@ -1086,9 +1086,10 @@ void CompositedLayerMapping::updateOverflowControlsHostLayerGeometry( |
transformState.flatten(); |
hostLayerPosition = LayoutPoint(transformState.lastPlanarPoint()); |
if (PaintLayerScrollableArea* scrollableArea = |
- compositingStackingContext->getScrollableArea()) |
+ compositingStackingContext->getScrollableArea()) { |
hostLayerPosition.move( |
- LayoutSize(scrollableArea->adjustedScrollOffset())); |
+ LayoutSize(toFloatSize(scrollableArea->scrollPosition()))); |
+ } |
hostLayerPosition.move(-stackingOffsetFromLayoutObject); |
} |
} else { |
@@ -1195,8 +1196,8 @@ void CompositedLayerMapping::updateScrollingLayerGeometry( |
LayoutBox* layoutBox = toLayoutBox(layoutObject()); |
IntRect overflowClipRect = |
enclosingIntRect(layoutBox->overflowClipRect(LayoutPoint())); |
- DoubleSize adjustedScrollOffset = |
- m_owningLayer.getScrollableArea()->adjustedScrollOffset(); |
+ FloatPoint scrollPosition = |
+ m_owningLayer.getScrollableArea()->scrollPosition(); |
m_scrollingLayer->setPosition(FloatPoint( |
overflowClipRect.location() - localCompositingBounds.location() + |
roundedIntSize(m_owningLayer.subpixelAccumulation()))); |
@@ -1223,8 +1224,8 @@ void CompositedLayerMapping::updateScrollingLayerGeometry( |
m_scrollingContentsLayer->setNeedsDisplay(); |
DoubleSize scrollingContentsOffset( |
- overflowClipRect.location().x() - adjustedScrollOffset.width(), |
- overflowClipRect.location().y() - adjustedScrollOffset.height()); |
+ overflowClipRect.location().x() - scrollPosition.x(), |
+ overflowClipRect.location().y() - scrollPosition.y()); |
// The scroll offset change is compared using floating point so that fractional scroll offset |
// change can be propagated to compositor. |
if (scrollingContentsOffset != m_scrollingContentsOffset || |
@@ -1232,9 +1233,8 @@ void CompositedLayerMapping::updateScrollingLayerGeometry( |
bool coordinatorHandlesOffset = |
compositor()->scrollingLayerDidChange(&m_owningLayer); |
m_scrollingContentsLayer->setPosition( |
- coordinatorHandlesOffset |
- ? FloatPoint() |
- : FloatPoint(-toFloatSize(adjustedScrollOffset))); |
+ coordinatorHandlesOffset ? FloatPoint() |
+ : FloatPoint(-toFloatSize(scrollPosition))); |
} |
m_scrollingContentsOffset = scrollingContentsOffset; |
@@ -2822,9 +2822,10 @@ void CompositedLayerMapping::adjustForCompositedScrolling( |
if (PaintLayerScrollableArea* scrollableArea = |
m_owningLayer.getScrollableArea()) { |
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(); |
+ // Note: this is the offset from the beginning of flow of the block, not the |
+ // offset from the top/left of the overflow rect. offsetFromLayoutObject adds |
+ // the origin offset from top/left to the beginning of flow. |
+ ScrollOffset scrollOffset = scrollableArea->scrollOffset(); |
offset.expand(-scrollOffset.width(), -scrollOffset.height()); |
} |
} |