Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp |
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp |
index 5697e821a9394033d5f7003f447482ec993e1ca6..d9ec6d4ecb20869b096b8c00e105436aeacfd3f8 100644 |
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp |
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp |
@@ -646,4 +646,23 @@ TEST_F(CompositedLayerMappingTest, ScrollingContentsAndForegroundLayerPaintingPh |
EXPECT_FALSE(mapping->foregroundLayer()); |
} |
+TEST_F(CompositedLayerMappingTest, BackgroundPaintedIntoGraphicsLayerIfNotCompositedScrolling) |
+{ |
+ document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true); |
+ setBodyInnerHTML( |
+ "<div id='container' style='overflow: scroll; width: 300px; height: 300px; border-radius: 5px; background: white; will-change: transform;'>" |
+ " <div style='background-color: blue; width: 2000px; height: 2000px;'></div>" |
+ "</div>"); |
+ |
+ PaintLayer* layer = toLayoutBlock(getLayoutObjectByElementId("container"))->layer(); |
+ EXPECT_TRUE(layer->canPaintBackgroundOntoScrollingContentsLayer()); |
+ |
+ // We currently don't use composited scrolling when the container has a border-radius |
+ // so even though we can paint the background onto the scrolling contents layer we |
+ // don't have a scrolling contents layer to paint into in this case. |
+ CompositedLayerMapping* mapping = layer->compositedLayerMapping(); |
+ EXPECT_FALSE(mapping->hasScrollingLayer()); |
+ EXPECT_FALSE(mapping->backgroundPaintsOntoScrollingContentsLayer()); |
+} |
+ |
} // namespace blink |