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

Unified Diff: third_party/WebKit/Source/core/layout/MapCoordinatesTest.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/MapCoordinatesTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp b/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp
index a61a1dfc37cf9f818ab041fa3a9556bd6063d24b..37ac17a2c30aab190e4af2b620806bcba65291ad 100644
--- a/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp
+++ b/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp
@@ -140,7 +140,7 @@ TEST_F(MapCoordinatesTest, OverflowClip) {
LayoutObject* target = getLayoutObjectByElementId("target");
LayoutObject* overflow = getLayoutObjectByElementId("overflow");
- toLayoutBox(overflow)->scrollToOffset(DoubleSize(32, 54));
+ toLayoutBox(overflow)->scrollToPosition(FloatPoint(32, 54));
FloatPoint mappedPoint = mapLocalToAncestor(
target, toLayoutBoxModelObject(target->parent()), FloatPoint(100, 100));
@@ -513,10 +513,9 @@ TEST_F(MapCoordinatesTest, FixedPosInTransform) {
"<div id='container'><div class='fixed' id='target'></div></div>"
"<div class='spacer'></div>");
- document().view()->setScrollPosition(DoublePoint(0.0, 50),
- ProgrammaticScroll);
+ document().view()->setScrollOffset(ScrollOffset(0.0, 50), ProgrammaticScroll);
document().view()->updateAllLifecyclePhases();
- EXPECT_EQ(50, document().view()->scrollPosition().y());
+ EXPECT_EQ(50, document().view()->scrollOffsetInt().height());
LayoutBox* target = toLayoutBox(getLayoutObjectByElementId("target"));
LayoutBox* container = toLayoutBox(getLayoutObjectByElementId("container"));
@@ -550,10 +549,9 @@ TEST_F(MapCoordinatesTest, FixedPosInContainPaint) {
"<div id='container'><div class='fixed' id='target'></div></div>"
"<div class='spacer'></div>");
- document().view()->setScrollPosition(DoublePoint(0.0, 50),
- ProgrammaticScroll);
+ document().view()->setScrollOffset(ScrollOffset(0.0, 50), ProgrammaticScroll);
document().view()->updateAllLifecyclePhases();
- EXPECT_EQ(50, document().view()->scrollPosition().y());
+ EXPECT_EQ(50, document().view()->scrollOffsetInt().height());
LayoutBox* target = toLayoutBox(getLayoutObjectByElementId("target"));
LayoutBox* container = toLayoutBox(getLayoutObjectByElementId("container"));
@@ -593,8 +591,8 @@ TEST_F(MapCoordinatesTest, FixedPosInIFrameWhenMainFrameScrolled) {
"<style>body { margin: 0; } #target { width: 200px; height: 200px; "
"position:fixed}</style><div id=target></div>");
- document().view()->setScrollPosition(DoublePoint(0.0, 1000),
- ProgrammaticScroll);
+ document().view()->setScrollOffset(ScrollOffset(0.0, 1000),
+ ProgrammaticScroll);
document().view()->updateAllLifecyclePhases();
Element* target = frameDocument.getElementById("target");
@@ -624,8 +622,8 @@ TEST_F(MapCoordinatesTest, IFrameTransformed) {
document().view()->updateAllLifecyclePhases();
- frameDocument.view()->setScrollPosition(DoublePoint(0.0, 1000),
- ProgrammaticScroll);
+ frameDocument.view()->setScrollOffset(ScrollOffset(0.0, 1000),
+ ProgrammaticScroll);
frameDocument.view()->updateAllLifecyclePhases();
Element* target = frameDocument.getElementById("target");
@@ -660,8 +658,8 @@ TEST_F(MapCoordinatesTest, FixedPosInScrolledIFrameWithTransform) {
"<div style='width: 200; height: 8000px'></div>");
document().view()->updateAllLifecyclePhases();
- frameDocument.view()->setScrollPosition(DoublePoint(0.0, 1000),
- ProgrammaticScroll);
+ frameDocument.view()->setScrollOffset(ScrollOffset(0.0, 1000),
+ ProgrammaticScroll);
Element* target = frameDocument.getElementById("target");
ASSERT_TRUE(target);
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutView.cpp ('k') | third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698