Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinderTest.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinderTest.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinderTest.cpp |
| index 49f8ffe7a5ffdcefa859c2eb07a6179c8460a5f2..2ed459c1d289896bf8161f09b1ec6eee0cb245d9 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinderTest.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinderTest.cpp |
| @@ -271,4 +271,36 @@ TEST_F(CompositingReasonFinderTest, RequiresCompositingForEffectAnimation) { |
| CompositingReasonFinder::requiresCompositingForEffectAnimation(*style)); |
| } |
| +TEST_F(CompositingReasonFinderTest, DoNotCompositeNestedSticky) { |
| + ScopedCompositeFixedPositionForTest compositeFixedPosition(true); |
| + |
| + setBodyInnerHTML( |
| + "<style>.scroller { overflow: scroll; height: 200px; width: 100px; }" |
| + ".container { height: 500px; }" |
| + ".opaque { background-color: white; contain: paint; }" |
| + "#outerSticky { height: 50px; position: sticky; top: 0px; }" |
| + "#innerSticky { height: 20px; position: sticky; top: 25px; }</style>" |
| + "<div class='scroller'>" |
| + " <div class='container'>" |
| + " <div id='outerSticky' class='opaque'>" |
| + " <div id='innerSticky' class='opaque'></div>" |
| + " </div>" |
| + " </div>" |
| + "</div>"); |
| + document().view()->updateAllLifecyclePhases(); |
| + |
| + Element* outerSticky = document().getElementById("outerSticky"); |
| + PaintLayer* outerStickyLayer = |
| + toLayoutBoxModelObject(outerSticky->layoutObject())->layer(); |
| + ASSERT_TRUE(outerStickyLayer); |
| + |
| + Element* innerSticky = document().getElementById("innerSticky"); |
| + PaintLayer* innerStickyLayer = |
| + toLayoutBoxModelObject(innerSticky->layoutObject())->layer(); |
| + ASSERT_TRUE(innerStickyLayer); |
| + |
| + EXPECT_NE(NotComposited, outerStickyLayer->compositingState()); |
|
flackr
2017/02/22 22:40:15
Expect PaintsIntoOwnBacking
smcgruer
2017/02/23 20:14:17
Done.
|
| + EXPECT_EQ(NotComposited, innerStickyLayer->compositingState()); |
| +} |
| + |
| } // namespace blink |