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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2343963002: Don't apply composited scrolling offsets if composited scrolling isn't happening. (Closed)
Patch Set: none Created 4 years, 3 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 | « third_party/WebKit/LayoutTests/compositing/overflow/scroll-neg-z-index-and-composited-child-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 288c35e5d3954370a2b0fc82fae901f04e0ec6ff..2030ff618d06b00c3114bd2feca684664fe8982c 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -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());
+ }
}
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/compositing/overflow/scroll-neg-z-index-and-composited-child-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698