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

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: Set define in core.gyp 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
« no previous file with comments | « Source/core/rendering/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayerCompositor.cpp
diff --git a/Source/core/rendering/RenderLayerCompositor.cpp b/Source/core/rendering/RenderLayerCompositor.cpp
index 449d7d34782a2c120c8f193ba6c17dc57bef0fe3..c5c9045b7a457f9d83c6b6c202ec0a1d7bec8c00 100644
--- a/Source/core/rendering/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/RenderLayerCompositor.cpp
@@ -1154,16 +1154,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()
@@ -1192,10 +1202,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)
« no previous file with comments | « Source/core/rendering/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698