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 283be2ff23491f030cce8f7b135386aade40d5b0..c6deda04fb893d0e326f537506141b1f85540458 100644 |
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp |
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp |
@@ -34,6 +34,11 @@ protected: |
return compositedLayerMapping->computeInterestRect(graphicsLayer, previousInterestRect); |
} |
+ bool shouldFlattenTransform(const GraphicsLayer& layer) const |
+ { |
+ return layer.shouldFlattenTransform(); |
+ } |
+ |
bool interestRectChangedEnoughToRepaint(const IntRect& previousInterestRect, const IntRect& newInterestRect, const IntSize& layerSize) |
{ |
return CompositedLayerMapping::interestRectChangedEnoughToRepaint(previousInterestRect, newInterestRect, layerSize); |
@@ -264,6 +269,25 @@ TEST_F(CompositedLayerMappingTest, ClippingMaskLayer) |
EXPECT_FALSE(graphicsLayer->contentsClippingMaskLayer()); |
} |
+TEST_F(CompositedLayerMappingTest, ScrollContentsFlattenForScroller) |
+{ |
+ setBodyInnerHTML( |
+ "<style>div::-webkit-scrollbar{ width: 5px; }</style>" |
+ "<div id='scroller' style='width: 100px; height: 100px; overflow: scroll; will-change: transform'>" |
+ "<div style='width: 1000px; height: 1000px;'>Foo</div>Foo</div>"); |
+ |
+ document().view()->updateAllLifecyclePhases(); |
+ Element* element = document().getElementById("scroller"); |
+ PaintLayer* paintLayer = toLayoutBoxModelObject(element->layoutObject())->layer(); |
+ CompositedLayerMapping* compositedLayerMapping = paintLayer->compositedLayerMapping(); |
+ |
+ ASSERT_TRUE(compositedLayerMapping); |
+ |
+ EXPECT_FALSE(shouldFlattenTransform(*compositedLayerMapping->mainGraphicsLayer())); |
+ EXPECT_FALSE(shouldFlattenTransform(*compositedLayerMapping->scrollingLayer())); |
+ EXPECT_TRUE(shouldFlattenTransform(*compositedLayerMapping->scrollingContentsLayer())); |
+} |
+ |
TEST_F(CompositedLayerMappingTest, InterestRectChangedEnoughToRepaintEmpty) |
{ |
IntSize layerSize(1000, 1000); |