| 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 7e308c2023c1fc0a1f67b776d35697e59b1d0ae9..79496d33ed1efec53521600e7328026dc4aae326 100644
|
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
|
| @@ -1688,4 +1688,49 @@ TEST_P(CompositedLayerMappingTest, StickyPositionTableCellContentOffset) {
|
| IntPoint(constraint.parentRelativeStickyBoxOffset));
|
| }
|
|
|
| +TEST_P(CompositedLayerMappingTest,
|
| + StickyPositionIntermediateContainerContentOffset) {
|
| + setBodyInnerHTML(
|
| + "<style>.composited { will-change: transform; }"
|
| + "#scroller { overflow: auto; height: 200px; width: 200px; }"
|
| + ".container { height: 500px; }"
|
| + ".innerPadding { height: 10px; }"
|
| + "#sticky { position: sticky; top: 25px; height: 50px; }</style>"
|
| + "<div id='scroller' class='composited'><div class='composited container'>"
|
| + " <div class='innerPadding'></div>"
|
| + " <div id='sticky' class='composited'></div>"
|
| + "</div></div>");
|
| +
|
| + CompositedLayerMapping* sticky =
|
| + toLayoutBlock(getLayoutObjectByElementId("sticky"))
|
| + ->layer()
|
| + ->compositedLayerMapping();
|
| + ASSERT_TRUE(sticky);
|
| +
|
| + WebLayerStickyPositionConstraint constraint =
|
| + sticky->mainGraphicsLayer()
|
| + ->contentLayer()
|
| + ->layer()
|
| + ->stickyPositionConstraint();
|
| + EXPECT_EQ(IntPoint(0, 10),
|
| + IntPoint(constraint.parentRelativeStickyBoxOffset));
|
| +
|
| + // Now scroll the page - this should not affect the parent-relative offset.
|
| + LayoutBoxModelObject* scroller =
|
| + toLayoutBoxModelObject(getLayoutObjectByElementId("scroller"));
|
| + PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea();
|
| + scrollableArea->scrollToAbsolutePosition(
|
| + FloatPoint(scrollableArea->scrollPosition().x(), 100));
|
| + ASSERT_EQ(100.0, scrollableArea->scrollPosition().y());
|
| +
|
| + document().view()->updateLifecycleToCompositingCleanPlusScrolling();
|
| +
|
| + constraint = sticky->mainGraphicsLayer()
|
| + ->contentLayer()
|
| + ->layer()
|
| + ->stickyPositionConstraint();
|
| + EXPECT_EQ(IntPoint(0, 10),
|
| + IntPoint(constraint.parentRelativeStickyBoxOffset));
|
| +}
|
| +
|
| } // namespace blink
|
|
|