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

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

Issue 2346883003: Only paint the background onto the scrolling contents layer if we have a scrolling contents layer. (Closed)
Patch Set: CompositedLayerMappingTest.BackgroundPaintedIntoGraphicsLayerIfNotCompositedScrolling 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/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

Powered by Google App Engine
This is Rietveld 408576698