Chromium Code Reviews| 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 f9e9c1e7acdc96ee82cd141590d4d6d39b267ada..aaaee8c578b7bdbb664dd5c4d21e66aa6d12ab25 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| @@ -1087,8 +1087,7 @@ void CompositedLayerMapping::updateOverflowControlsHostLayerGeometry( |
| hostLayerPosition = LayoutPoint(transformState.lastPlanarPoint()); |
| if (PaintLayerScrollableArea* scrollableArea = |
| compositingStackingContext->getScrollableArea()) |
| - hostLayerPosition.move( |
| - LayoutSize(scrollableArea->adjustedScrollOffset())); |
| + hostLayerPosition.move(LayoutSize(scrollableArea->offsetFromOrigin())); |
| hostLayerPosition.move(-stackingOffsetFromLayoutObject); |
| } |
| } else { |
| @@ -1195,8 +1194,8 @@ void CompositedLayerMapping::updateScrollingLayerGeometry( |
| LayoutBox* layoutBox = toLayoutBox(layoutObject()); |
| IntRect overflowClipRect = |
| enclosingIntRect(layoutBox->overflowClipRect(LayoutPoint())); |
| - DoubleSize adjustedScrollOffset = |
| - m_owningLayer.getScrollableArea()->adjustedScrollOffset(); |
| + DoubleSize scrollOffsetFromOrigin = |
| + m_owningLayer.getScrollableArea()->offsetFromOrigin(); |
| m_scrollingLayer->setPosition(FloatPoint( |
| overflowClipRect.location() - localCompositingBounds.location() + |
| roundedIntSize(m_owningLayer.subpixelAccumulation()))); |
| @@ -1223,8 +1222,8 @@ void CompositedLayerMapping::updateScrollingLayerGeometry( |
| m_scrollingContentsLayer->setNeedsDisplay(); |
| DoubleSize scrollingContentsOffset( |
| - overflowClipRect.location().x() - adjustedScrollOffset.width(), |
| - overflowClipRect.location().y() - adjustedScrollOffset.height()); |
| + overflowClipRect.location().x() - scrollOffsetFromOrigin.width(), |
| + overflowClipRect.location().y() - scrollOffsetFromOrigin.height()); |
| // The scroll offset change is compared using floating point so that fractional scroll offset |
| // change can be propagated to compositor. |
| if (scrollingContentsOffset != m_scrollingContentsOffset || |
| @@ -1234,7 +1233,7 @@ void CompositedLayerMapping::updateScrollingLayerGeometry( |
| m_scrollingContentsLayer->setPosition( |
| coordinatorHandlesOffset |
| ? FloatPoint() |
| - : FloatPoint(-toFloatSize(adjustedScrollOffset))); |
| + : FloatPoint(-toFloatSize(scrollOffsetFromOrigin))); |
| } |
| m_scrollingContentsOffset = scrollingContentsOffset; |
| @@ -2824,8 +2823,8 @@ void CompositedLayerMapping::adjustForCompositedScrolling( |
| if (scrollableArea->usesCompositedScrolling()) { |
| // Note: this is just the scroll offset, *not* the "adjusted scroll offset". Scroll offset |
|
bokan
2016/10/01 20:32:47
This comment needs to be updated
szager1
2016/10/02 19:35:28
Done.
|
| // does not include the origin adjustment. That is instead baked already into offsetFromLayoutObject. |
| - DoubleSize scrollOffset = scrollableArea->scrollOffset(); |
| - offset.expand(-scrollOffset.width(), -scrollOffset.height()); |
| + IntPoint scrollPosition = scrollableArea->scrollPosition(); |
| + offset.expand(-scrollPosition.x(), -scrollPosition.y()); |
| } |
| } |
| } |