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

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

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Created 4 years, 2 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 e092185b20439e26b00511898cc5742b8f720cb2..003480c82e4b2798f5180c2e68af8c4ec3c87286 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp
@@ -42,9 +42,9 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionConstraints) {
LayoutBoxModelObject* scroller =
toLayoutBoxModelObject(getLayoutObjectByElementId("scroller"));
PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea();
- scrollableArea->scrollToOffsetFromOrigin(
- DoubleSize(scrollableArea->offsetFromOrigin().width(), 50));
- ASSERT_EQ(50.0, scrollableArea->offsetFromOrigin().height());
+ scrollableArea->scrollToAbsolutePosition(
+ FloatPoint(scrollableArea->scrollOffsetInt().width(), 50));
+ ASSERT_EQ(50.0, scrollableArea->absolutePosition().y());
LayoutBoxModelObject* sticky =
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky"));
sticky->updateStickyPositionConstraints();
@@ -78,10 +78,10 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionTransforms) {
"id='sticky'></div></div><div class='spacer'></div></div>");
LayoutBoxModelObject* scroller =
toLayoutBoxModelObject(getLayoutObjectByElementId("scroller"));
- DoubleSize newOffset(
- scroller->getScrollableArea()->offsetFromOrigin().width(), 50);
- scroller->getScrollableArea()->scrollToOffsetFromOrigin(newOffset);
- ASSERT_EQ(50.0, scroller->getScrollableArea()->offsetFromOrigin().height());
+ PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea();
+ scrollableArea->scrollToAbsolutePosition(
+ FloatPoint(scrollableArea->scrollOffsetInt().width(), 50));
+ ASSERT_EQ(50.0, scrollableArea->absolutePosition().y());
LayoutBoxModelObject* sticky =
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky"));
sticky->updateStickyPositionConstraints();
@@ -116,9 +116,9 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionPercentageStyles) {
LayoutBoxModelObject* scroller =
toLayoutBoxModelObject(getLayoutObjectByElementId("scroller"));
PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea();
- scrollableArea->scrollToOffsetFromOrigin(
- DoubleSize(scrollableArea->offsetFromOrigin().width(), 50));
- ASSERT_EQ(50.0, scrollableArea->offsetFromOrigin().height());
+ scrollableArea->scrollToAbsolutePosition(
+ FloatPoint(scrollableArea->absolutePosition().x(), 50));
+ ASSERT_EQ(50.0, scrollableArea->absolutePosition().y());
LayoutBoxModelObject* sticky =
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky"));
sticky->updateStickyPositionConstraints();
@@ -150,9 +150,9 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionContainerIsScroller) {
LayoutBoxModelObject* scroller =
toLayoutBoxModelObject(getLayoutObjectByElementId("scroller"));
PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea();
- scrollableArea->scrollToOffsetFromOrigin(
- DoubleSize(scrollableArea->offsetFromOrigin().width(), 50));
- ASSERT_EQ(50.0, scrollableArea->offsetFromOrigin().height());
+ scrollableArea->scrollToAbsolutePosition(
+ FloatPoint(scrollableArea->absolutePosition().x(), 50));
+ ASSERT_EQ(50.0, scrollableArea->absolutePosition().y());
LayoutBoxModelObject* sticky =
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky"));
sticky->updateStickyPositionConstraints();
@@ -185,9 +185,9 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionAnonymousContainer) {
LayoutBoxModelObject* scroller =
toLayoutBoxModelObject(getLayoutObjectByElementId("scroller"));
PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea();
- scrollableArea->scrollToOffsetFromOrigin(
- DoubleSize(scrollableArea->offsetFromOrigin().width(), 50));
- ASSERT_EQ(50.0, scrollableArea->offsetFromOrigin().height());
+ scrollableArea->scrollToAbsolutePosition(
+ FloatPoint(scrollableArea->absolutePosition().x(), 50));
+ ASSERT_EQ(50.0, scrollableArea->absolutePosition().y());
LayoutBoxModelObject* sticky =
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky"));
sticky->updateStickyPositionConstraints();

Powered by Google App Engine
This is Rietveld 408576698