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

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

Issue 2353623004: Only paint the background onto the scrolling contents layer if we have a scrolling contents layer. (Closed)
Patch Set: Use local background on test. 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
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 08b9b26253ca139f99e28bfae2334ab49d01b0c2..8c1d53300fb8cff086f9dc9ace6f960d16d68171 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -297,7 +297,12 @@ void CompositedLayerMapping::updateIsRootForIsolatedGroup()
void CompositedLayerMapping::updateBackgroundPaintsOntoScrollingContentsLayer()
{
- bool shouldPaintOntoScrollingContentsLayer = shouldPaintBackgroundOntoScrollingContentsLayer();
+ // We can only paint the background onto the scrolling contents layer if
+ // it would be visually correct and we are using composited scrolling meaning we
+ // have a scrolling contents layer to paint it into.
+ bool shouldPaintOntoScrollingContentsLayer =
+ canPaintBackgroundOntoScrollingContentsLayer()
+ && m_owningLayer.getScrollableArea()->usesCompositedScrolling();
if (shouldPaintOntoScrollingContentsLayer != backgroundPaintsOntoScrollingContentsLayer()) {
m_backgroundPaintsOntoScrollingContentsLayer = shouldPaintOntoScrollingContentsLayer;
// If the background is no longer painted onto the scrolling contents
@@ -2587,7 +2592,7 @@ bool CompositedLayerMapping::invalidateLayerIfNoPrecedingEntry(size_t indexToCle
return false;
}
-bool CompositedLayerMapping::shouldPaintBackgroundOntoScrollingContentsLayer() const
+bool CompositedLayerMapping::canPaintBackgroundOntoScrollingContentsLayer() const
{
// TODO(flackr): Add support for painting locally attached background images. https://crbug.com/625882
const FillLayer& backgroundLayer = m_owningLayer.layoutObject()->style()->backgroundLayers();

Powered by Google App Engine
This is Rietveld 408576698