Index: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
index 3b685597d828d7be414c0362dd314c82aad40ff1..5e5909494d65375de366f5f0a2a33474422d40f0 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
@@ -265,6 +265,7 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerContents(GraphicsCon |
bool isPaintingCompositedForeground = paintFlags & PaintLayerPaintingCompositingForegroundPhase; |
bool isPaintingCompositedBackground = paintFlags & PaintLayerPaintingCompositingBackgroundPhase; |
bool isPaintingOverflowContents = paintFlags & PaintLayerPaintingOverflowContents; |
+ bool isPaintingBackgroundOntoForeground = paintFlags & PaintLayerPaintingBackgroundOntoForeground; |
// Outline always needs to be painted even if we have no visible content. Also, |
// the outline is painted in the background phase during composited scrolling. |
// If it were painted in the foreground phase, it would move with the scrolled |
@@ -381,7 +382,9 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerContents(GraphicsCon |
scopedPaintChunkProperties.emplace(context.getPaintController(), m_paintLayer, properties); |
} |
- bool shouldPaintBackground = isPaintingCompositedBackground && shouldPaintContent && !selectionOnly; |
+ bool shouldPaintBackground = shouldPaintContent && !selectionOnly |
+ && ((isPaintingBackgroundOntoForeground && isPaintingCompositedForeground) |
+ || isPaintingCompositedBackground); |
bool shouldPaintNegZOrderList = (isPaintingScrollingContent && isPaintingOverflowContents) || (!isPaintingScrollingContent && isPaintingCompositedBackground); |
bool shouldPaintOwnContents = isPaintingCompositedForeground && shouldPaintContent; |
bool shouldPaintNormalFlowAndPosZOrderLists = isPaintingCompositedForeground; |