OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/layout/compositing/CompositedLayerMapping.h" | 5 #include "core/layout/compositing/CompositedLayerMapping.h" |
6 | 6 |
7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
8 #include "core/layout/LayoutBoxModelObject.h" | 8 #include "core/layout/LayoutBoxModelObject.h" |
9 #include "core/layout/LayoutTestHelper.h" | 9 #include "core/layout/LayoutTestHelper.h" |
10 #include "core/layout/api/LayoutViewItem.h" | 10 #include "core/layout/api/LayoutViewItem.h" |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 ASSERT_TRUE(sticky2); | 1292 ASSERT_TRUE(sticky2); |
1293 WebLayerStickyPositionConstraint constraint2 = | 1293 WebLayerStickyPositionConstraint constraint2 = |
1294 sticky2->mainGraphicsLayer() | 1294 sticky2->mainGraphicsLayer() |
1295 ->contentLayer() | 1295 ->contentLayer() |
1296 ->layer() | 1296 ->layer() |
1297 ->stickyPositionConstraint(); | 1297 ->stickyPositionConstraint(); |
1298 EXPECT_EQ(IntPoint(-50, -50), | 1298 EXPECT_EQ(IntPoint(-50, -50), |
1299 IntPoint(constraint2.parentRelativeStickyBoxOffset)); | 1299 IntPoint(constraint2.parentRelativeStickyBoxOffset)); |
1300 } | 1300 } |
1301 | 1301 |
| 1302 TEST_P(CompositedLayerMappingTest, StickyPositionTableCellContentOffset) { |
| 1303 setBodyInnerHTML( |
| 1304 "<style>body {height: 2000px; width: 2000px;} " |
| 1305 "td, th { height: 50px; width: 50px; } " |
| 1306 "table {border: none; }" |
| 1307 "#scroller { overflow: auto; will-change: transform; height: 50px; }" |
| 1308 "#sticky { position: sticky; left: 0; will-change: transform; }" |
| 1309 "</style>" |
| 1310 "<div id='scroller'><table cellspacing='0' cellpadding='0'>" |
| 1311 " <thead><tr><td></td></tr></thead>" |
| 1312 " <tr><td id='sticky'></td></tr>" |
| 1313 "</table></div>"); |
| 1314 document().view()->updateLifecycleToCompositingCleanPlusScrolling(); |
| 1315 |
| 1316 CompositedLayerMapping* sticky = |
| 1317 toLayoutBlock(getLayoutObjectByElementId("sticky")) |
| 1318 ->layer() |
| 1319 ->compositedLayerMapping(); |
| 1320 |
| 1321 ASSERT_TRUE(sticky); |
| 1322 WebLayerStickyPositionConstraint constraint = |
| 1323 sticky->mainGraphicsLayer() |
| 1324 ->contentLayer() |
| 1325 ->layer() |
| 1326 ->stickyPositionConstraint(); |
| 1327 EXPECT_EQ(IntPoint(0, 50), |
| 1328 IntPoint(constraint.parentRelativeStickyBoxOffset)); |
| 1329 } |
| 1330 |
1302 } // namespace blink | 1331 } // namespace blink |
OLD | NEW |