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

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

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Fix README.md 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 3ef9719f0918ead291cf54a18a7ebecbd9600e9d..97c69167f5dc870b773352980de52dd6de574464 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->scrollToOffset(
- DoubleSize(scrollableArea->adjustedScrollOffset().width(), 50));
- ASSERT_EQ(50.0, scrollableArea->adjustedScrollOffset().height());
+ scrollableArea->scrollToAbsolutePosition(
+ FloatPoint(scrollableArea->scrollOffsetInt().width(), 50));
+ ASSERT_EQ(50.0, scrollableArea->scrollPosition().y());
LayoutBoxModelObject* sticky =
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky"));
sticky->updateStickyPositionConstraints();
@@ -79,9 +79,9 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionTransforms) {
LayoutBoxModelObject* scroller =
toLayoutBoxModelObject(getLayoutObjectByElementId("scroller"));
PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea();
- scrollableArea->scrollToOffset(
- DoubleSize(scrollableArea->adjustedScrollOffset().width(), 50));
- ASSERT_EQ(50.0, scrollableArea->adjustedScrollOffset().height());
+ scrollableArea->scrollToAbsolutePosition(
+ FloatPoint(scrollableArea->scrollOffsetInt().width(), 50));
+ ASSERT_EQ(50.0, scrollableArea->scrollPosition().y());
LayoutBoxModelObject* sticky =
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky"));
sticky->updateStickyPositionConstraints();
@@ -115,9 +115,9 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionPercentageStyles) {
LayoutBoxModelObject* scroller =
toLayoutBoxModelObject(getLayoutObjectByElementId("scroller"));
PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea();
- scrollableArea->scrollToOffset(
- DoubleSize(scrollableArea->adjustedScrollOffset().width(), 50));
- ASSERT_EQ(50.0, scrollableArea->adjustedScrollOffset().height());
+ scrollableArea->scrollToAbsolutePosition(
+ FloatPoint(scrollableArea->scrollPosition().x(), 50));
+ ASSERT_EQ(50.0, scrollableArea->scrollPosition().y());
LayoutBoxModelObject* sticky =
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky"));
sticky->updateStickyPositionConstraints();
@@ -149,9 +149,9 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionContainerIsScroller) {
LayoutBoxModelObject* scroller =
toLayoutBoxModelObject(getLayoutObjectByElementId("scroller"));
PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea();
- scrollableArea->scrollToOffset(
- DoubleSize(scrollableArea->adjustedScrollOffset().width(), 50));
- ASSERT_EQ(50.0, scrollableArea->adjustedScrollOffset().height());
+ scrollableArea->scrollToAbsolutePosition(
+ FloatPoint(scrollableArea->scrollPosition().x(), 50));
+ ASSERT_EQ(50.0, scrollableArea->scrollPosition().y());
LayoutBoxModelObject* sticky =
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky"));
sticky->updateStickyPositionConstraints();
@@ -184,9 +184,9 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionAnonymousContainer) {
LayoutBoxModelObject* scroller =
toLayoutBoxModelObject(getLayoutObjectByElementId("scroller"));
PaintLayerScrollableArea* scrollableArea = scroller->getScrollableArea();
- scrollableArea->scrollToOffset(
- DoubleSize(scrollableArea->adjustedScrollOffset().width(), 50));
- ASSERT_EQ(50.0, scrollableArea->adjustedScrollOffset().height());
+ scrollableArea->scrollToAbsolutePosition(
+ FloatPoint(scrollableArea->scrollPosition().x(), 50));
+ ASSERT_EQ(50.0, scrollableArea->scrollPosition().y());
LayoutBoxModelObject* sticky =
toLayoutBoxModelObject(getLayoutObjectByElementId("sticky"));
sticky->updateStickyPositionConstraints();

Powered by Google App Engine
This is Rietveld 408576698