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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp

Issue 2698843004: Correct for enclosing layers scroll position in sticky_data->main_thread_offset (Closed)
Patch Set: Remove check for containingLayer and make unittest more nested Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..21b74db556fa5834082cdf880610bcb04d99653f 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
@@ -1688,4 +1688,51 @@ 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='composited container'>"
+ " <div class='innerPadding'></div>"
+ " <div id='sticky' class='composited'></div>"
+ " </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();
flackr 2017/02/22 16:14:49 Does this actually call updateStickyConstraints? W
smcgruer 2017/02/22 18:39:04 It appears to be: [133571:133571:0222/133838.6476
+
+ constraint = sticky->mainGraphicsLayer()
+ ->contentLayer()
+ ->layer()
+ ->stickyPositionConstraint();
+ EXPECT_EQ(IntPoint(0, 10),
+ IntPoint(constraint.parentRelativeStickyBoxOffset));
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698