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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp

Issue 2646133002: Add offset contributed to sticky position box rect by location containers (Closed)
Patch Set: Add localToAncestorQuadInternal. Created 3 years, 11 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
Index: third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp
index 9fbdbbdc0334a6846b9c92221a2d739b6697cc32..57d56823a56cd19bdb11004f1698670cfba96f65 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp
@@ -249,4 +249,33 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionAnonymousContainer) {
IntRect(15, 165, 100, 100),
enclosingIntRect(getScrollContainerRelativeStickyBoxRect(constraints)));
}
+
+TEST_F(LayoutBoxModelObjectTest, StickyPositionTableContainers) {
+ setBodyInnerHTML(
+ "<style> td, th { height: 50px; width: 50px; } "
+ "#sticky { position: sticky; left: 0; will-change: transform; }"
+ "table {border: none; }"
+ "#scroller { overflow: auto; }"
+ "</style>"
+ "<div id='scroller'>"
+ "<table cellspacing='0' cellpadding='0'>"
+ " <thead><tr><td></td></tr></thead>"
+ " <tr><td id='sticky'></td></tr>"
+ "</table></div>");
+ LayoutBoxModelObject* scroller =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("scroller"));
+ PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea();
+ LayoutBoxModelObject* sticky =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("sticky"));
+ sticky->updateStickyPositionConstraints();
+ const StickyPositionScrollingConstraints& constraints =
+ scrollableArea->stickyConstraintsMap().get(sticky->layer());
+ ASSERT_EQ(IntRect(0, 0, 50, 100),
Xianzhu 2017/01/25 18:52:26 Nit: I prefer EXPECT_EQ to ASSERT_EQ for non-fatal
flackr 2017/01/25 18:56:35 Done.
+ enclosingIntRect(
+ getScrollContainerRelativeContainingBlockRect(constraints)));
+ ASSERT_EQ(
+ IntRect(0, 50, 50, 50),
+ enclosingIntRect(getScrollContainerRelativeStickyBoxRect(constraints)));
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698