| 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 61a061aa8280ef32a86d3b45cf168f7a1381b683..9c66cce9f35c2b09266c36f3e64035549ee6ec1b 100644
|
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
|
| @@ -601,4 +601,29 @@ TEST_F(CompositedLayerMappingTest, InterestRectOfIframeWithContentBoxOffset)
|
| EXPECT_RECT_EQ(IntRect(0, 0, 500, 7500), recomputeInterestRect(frameDocument.view()->layoutView()->enclosingLayer()->graphicsLayerBacking()));
|
| }
|
|
|
| +TEST_F(CompositedLayerMappingTest, ScrollingContentsAndForegroundLayerPaintingPhase)
|
| +{
|
| + document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true);
|
| + setBodyInnerHTML(
|
| + "<div id='container' style='position: relative; z-index: 1; overflow: scroll; width: 300px; height: 300px'>"
|
| + " <div id='negative-composited-child' style='background-color: red; width: 1px; height: 1px; position: absolute; backface-visibility: hidden; z-index: -1'></div>"
|
| + " <div style='background-color: blue; width: 2000px; height: 2000px; position: relative; top: 10px'></div>"
|
| + "</div>");
|
| +
|
| + CompositedLayerMapping* mapping = toLayoutBlock(getLayoutObjectByElementId("container"))->layer()->compositedLayerMapping();
|
| + ASSERT_TRUE(mapping->scrollingContentsLayer());
|
| + EXPECT_EQ(static_cast<GraphicsLayerPaintingPhase>(GraphicsLayerPaintOverflowContents | GraphicsLayerPaintCompositedScroll), mapping->scrollingContentsLayer()->paintingPhase());
|
| + ASSERT_TRUE(mapping->foregroundLayer());
|
| + EXPECT_EQ(static_cast<GraphicsLayerPaintingPhase>(GraphicsLayerPaintForeground | GraphicsLayerPaintOverflowContents), mapping->foregroundLayer()->paintingPhase());
|
| +
|
| + Element* negativeCompositedChild = document().getElementById("negative-composited-child");
|
| + negativeCompositedChild->parentNode()->removeChild(negativeCompositedChild);
|
| + document().view()->updateAllLifecyclePhases();
|
| +
|
| + mapping = toLayoutBlock(getLayoutObjectByElementId("container"))->layer()->compositedLayerMapping();
|
| + ASSERT_TRUE(mapping->scrollingContentsLayer());
|
| + EXPECT_EQ(static_cast<GraphicsLayerPaintingPhase>(GraphicsLayerPaintOverflowContents | GraphicsLayerPaintCompositedScroll | GraphicsLayerPaintForeground), mapping->scrollingContentsLayer()->paintingPhase());
|
| + EXPECT_FALSE(mapping->foregroundLayer());
|
| +}
|
| +
|
| } // namespace blink
|
|
|