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 d92b3d3f96ef384b9a9186c8989342ac004f3156..3ef9719f0918ead291cf54a18a7ebecbd9600e9d 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp |
@@ -41,16 +41,17 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionConstraints) { |
"id='sticky'></div></div><div class='spacer'></div></div>"); |
LayoutBoxModelObject* scroller = |
toLayoutBoxModelObject(getLayoutObjectByElementId("scroller")); |
- scroller->getScrollableArea()->scrollToYOffset(50); |
- ASSERT_EQ(50.0, scroller->getScrollableArea()->scrollYOffset()); |
+ PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea(); |
+ scrollableArea->scrollToOffset( |
+ DoubleSize(scrollableArea->adjustedScrollOffset().width(), 50)); |
+ ASSERT_EQ(50.0, scrollableArea->adjustedScrollOffset().height()); |
LayoutBoxModelObject* sticky = |
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky")); |
sticky->updateStickyPositionConstraints(); |
ASSERT_EQ(scroller->layer(), sticky->layer()->ancestorOverflowLayer()); |
const StickyPositionScrollingConstraints& constraints = |
- scroller->getScrollableArea()->stickyConstraintsMap().get( |
- sticky->layer()); |
+ scrollableArea->stickyConstraintsMap().get(sticky->layer()); |
ASSERT_EQ(0.f, constraints.topOffset()); |
// The coordinates of the constraint rects should all be with respect to the unscrolled scroller. |
@@ -77,16 +78,17 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionTransforms) { |
"id='sticky'></div></div><div class='spacer'></div></div>"); |
LayoutBoxModelObject* scroller = |
toLayoutBoxModelObject(getLayoutObjectByElementId("scroller")); |
- scroller->getScrollableArea()->scrollToYOffset(50); |
- ASSERT_EQ(50.0, scroller->getScrollableArea()->scrollYOffset()); |
+ PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea(); |
+ scrollableArea->scrollToOffset( |
+ DoubleSize(scrollableArea->adjustedScrollOffset().width(), 50)); |
+ ASSERT_EQ(50.0, scrollableArea->adjustedScrollOffset().height()); |
LayoutBoxModelObject* sticky = |
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky")); |
sticky->updateStickyPositionConstraints(); |
ASSERT_EQ(scroller->layer(), sticky->layer()->ancestorOverflowLayer()); |
const StickyPositionScrollingConstraints& constraints = |
- scroller->getScrollableArea()->stickyConstraintsMap().get( |
- sticky->layer()); |
+ scrollableArea->stickyConstraintsMap().get(sticky->layer()); |
ASSERT_EQ(0.f, constraints.topOffset()); |
// The coordinates of the constraint rects should all be with respect to the unscrolled scroller. |
@@ -112,16 +114,17 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionPercentageStyles) { |
"id='sticky'></div></div><div class='spacer'></div></div>"); |
LayoutBoxModelObject* scroller = |
toLayoutBoxModelObject(getLayoutObjectByElementId("scroller")); |
- scroller->getScrollableArea()->scrollToYOffset(50); |
- ASSERT_EQ(50.0, scroller->getScrollableArea()->scrollYOffset()); |
+ PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea(); |
+ scrollableArea->scrollToOffset( |
+ DoubleSize(scrollableArea->adjustedScrollOffset().width(), 50)); |
+ ASSERT_EQ(50.0, scrollableArea->adjustedScrollOffset().height()); |
LayoutBoxModelObject* sticky = |
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky")); |
sticky->updateStickyPositionConstraints(); |
ASSERT_EQ(scroller->layer(), sticky->layer()->ancestorOverflowLayer()); |
const StickyPositionScrollingConstraints& constraints = |
- scroller->getScrollableArea()->stickyConstraintsMap().get( |
- sticky->layer()); |
+ scrollableArea->stickyConstraintsMap().get(sticky->layer()); |
ASSERT_EQ(0.f, constraints.topOffset()); |
ASSERT_EQ(IntRect(25, 145, 200, 330), |
@@ -145,16 +148,17 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionContainerIsScroller) { |
"class='spacer'></div></div>"); |
LayoutBoxModelObject* scroller = |
toLayoutBoxModelObject(getLayoutObjectByElementId("scroller")); |
- scroller->getScrollableArea()->scrollToYOffset(50); |
- ASSERT_EQ(50.0, scroller->getScrollableArea()->scrollYOffset()); |
+ PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea(); |
+ scrollableArea->scrollToOffset( |
+ DoubleSize(scrollableArea->adjustedScrollOffset().width(), 50)); |
+ ASSERT_EQ(50.0, scrollableArea->adjustedScrollOffset().height()); |
LayoutBoxModelObject* sticky = |
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky")); |
sticky->updateStickyPositionConstraints(); |
ASSERT_EQ(scroller->layer(), sticky->layer()->ancestorOverflowLayer()); |
const StickyPositionScrollingConstraints& constraints = |
- scroller->getScrollableArea()->stickyConstraintsMap().get( |
- sticky->layer()); |
+ scrollableArea->stickyConstraintsMap().get(sticky->layer()); |
ASSERT_EQ(IntRect(0, 0, 400, 1100), |
enclosingIntRect( |
getScrollContainerRelativeContainingBlockRect(constraints))); |
@@ -179,16 +183,17 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionAnonymousContainer) { |
"id='sticky'></div></div><div class='spacer'></div></div>"); |
LayoutBoxModelObject* scroller = |
toLayoutBoxModelObject(getLayoutObjectByElementId("scroller")); |
- scroller->getScrollableArea()->scrollToYOffset(50); |
- ASSERT_EQ(50.0, scroller->getScrollableArea()->scrollYOffset()); |
+ PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea(); |
+ scrollableArea->scrollToOffset( |
+ DoubleSize(scrollableArea->adjustedScrollOffset().width(), 50)); |
+ ASSERT_EQ(50.0, scrollableArea->adjustedScrollOffset().height()); |
LayoutBoxModelObject* sticky = |
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky")); |
sticky->updateStickyPositionConstraints(); |
ASSERT_EQ(scroller->layer(), sticky->layer()->ancestorOverflowLayer()); |
const StickyPositionScrollingConstraints& constraints = |
- scroller->getScrollableArea()->stickyConstraintsMap().get( |
- sticky->layer()); |
+ scrollableArea->stickyConstraintsMap().get(sticky->layer()); |
ASSERT_EQ(IntRect(15, 115, 170, 370), |
enclosingIntRect( |
getScrollContainerRelativeContainingBlockRect(constraints))); |