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

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

Issue 2494933002: Exclude border from overflow scroller in sticky constraints. (Closed)
Patch Set: Created 4 years, 1 month 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/LayoutBoxModelObject.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/LayoutBoxModelObjectTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp
index 8a08b8668ce0334c1c86460446a2fc880892e0a9..1f4b15ccab09468c8eb6a5408909e0b69b9494a2 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp
@@ -34,8 +34,8 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionConstraints) {
"}"
"#container { box-sizing: border-box; position: relative; top: 100px; "
"height: 400px; width: 200px; padding: 10px; border: 5px solid black; }"
- "#scroller { height: 100px; overflow: auto; position: relative; top: "
- "200px; }"
+ "#scroller { width: 400px; height: 100px; overflow: auto; "
+ "position: relative; top: 200px; border: 2px solid black; }"
".spacer { height: 1000px; }</style>"
"<div id='scroller'><div id='container'><div "
"id='sticky'></div></div><div class='spacer'></div></div>");
@@ -62,6 +62,10 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionConstraints) {
ASSERT_EQ(
IntRect(15, 115, 100, 100),
enclosingIntRect(getScrollContainerRelativeStickyBoxRect(constraints)));
+
+ // The sticky constraining rect also doesn't include the border offset.
chrishtr 2016/11/12 00:17:20 Please add a vertical-rl example also.
flackr 2016/11/14 14:50:14 Done.
+ ASSERT_EQ(IntRect(0, 50, 400, 100),
+ enclosingIntRect(sticky->computeStickyConstrainingRect()));
}
// Verifies that the sticky constraints are not affected by transforms
@@ -144,7 +148,7 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionContainerIsScroller) {
"<style>#sticky { position: sticky; top: 0; width: 100px; height: 100px; "
"}"
"#scroller { height: 100px; width: 400px; overflow: auto; position: "
- "relative; top: 200px; }"
+ "relative; top: 200px; border: 2px solid black; }"
".spacer { height: 1000px; }</style>"
"<div id='scroller'><div id='sticky'></div><div "
"class='spacer'></div></div>");
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698