Chromium Code Reviews| 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>"); |