Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1106)

Unified Diff: Source/core/rendering/RenderLayerCompositor.cpp

Issue 18187004: Don't update graphics layer positions during coordinated scrolling (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ifdefs, expectations, rtl fixes Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RenderLayerCompositor.cpp
diff --git a/Source/core/rendering/RenderLayerCompositor.cpp b/Source/core/rendering/RenderLayerCompositor.cpp
index 5375e292a8db2272cc2a0594ce59cbe73d3f80d4..e0b786486dfb01f026dd01e19be7c6db7c4acb28 100644
--- a/Source/core/rendering/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/RenderLayerCompositor.cpp
@@ -1175,16 +1175,26 @@ void RenderLayerCompositor::frameViewDidScroll()
if (!m_scrollLayer)
return;
- // If there's a scrolling coordinator that manages scrolling for this frame view,
- // it will also manage updating the scroll layer position.
+ bool scrollingCoordinatorHandlesOffset = false;
if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) {
if (Settings* settings = m_renderView->document()->settings()) {
if (isMainFrame() || settings->compositedScrollingForFramesEnabled())
- scrollingCoordinator->scrollableAreaScrollLayerDidChange(frameView);
+ scrollingCoordinatorHandlesOffset = scrollingCoordinator->scrollableAreaScrollLayerDidChange(frameView);
}
}
- m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));
+#ifndef BLINK_SCROLLING_POSITION_NO_OFFSET
+ // FIXME: Remove when possible. Only required to stage multi-repo change.
+ scrollingCoordinatorHandlesOffset = false;
+#endif
+
+ // Scroll position = scroll minimum + scroll offset. Adjust the layer's
+ // position to handle whatever the scroll coordinator isn't handling.
+ // The minimum scroll position is non-zero for RTL pages with overflow.
+ if (scrollingCoordinatorHandlesOffset)
+ m_scrollLayer->setPosition(-frameView->minimumScrollPosition());
+ else
+ m_scrollLayer->setPosition(-scrollPosition);
}
void RenderLayerCompositor::frameViewDidLayout()
@@ -1213,10 +1223,11 @@ void RenderLayerCompositor::rootFixedBackgroundsChanged()
m_clipLayer->addChildBelow(backgroundLayer, m_scrollLayer.get());
}
-void RenderLayerCompositor::scrollingLayerDidChange(RenderLayer* layer)
+bool RenderLayerCompositor::scrollingLayerDidChange(RenderLayer* layer)
{
if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
- scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer);
+ return scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer);
+ return false;
}
String RenderLayerCompositor::layerTreeAsText(LayerTreeFlags flags)
« Source/core/rendering/RenderLayerBacking.cpp ('K') | « Source/core/rendering/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698