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

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: Merge with master 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 77c1f7a1d72c332676723e0bc61f37eaff128d5c..900bf9ccccca64474ff9976948106842c53a7e81 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
@@ -647,6 +647,25 @@ 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());
+}
+
// Make sure that clipping layers are removed or their masking bit turned off
// when they're an ancestor of the root scroller element.
TEST_F(CompositedLayerMappingTest, RootScrollerAncestorsNotClipped)

Powered by Google App Engine
This is Rietveld 408576698