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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.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/compositing/CompositedLayerMappingTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
index 9d6f149d471117f225417ce1c7f3227ab70d49dd..beb9b5dc29c68a67f1825c5dd3b43bd2aa2131e3 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
@@ -126,8 +126,8 @@ TEST_F(CompositedLayerMappingTest, VerticalRightLeftWritingModeDocument) {
"200px;'></div>");
document().view()->updateAllLifecyclePhases();
- document().view()->setScrollPosition(DoublePoint(-5000, 0),
- ProgrammaticScroll);
+ document().view()->setScrollOffset(ScrollOffset(-5000, 0),
+ ProgrammaticScroll);
document().view()->updateAllLifecyclePhases();
PaintLayer* paintLayer = document().layoutViewItem().layer();
@@ -456,7 +456,7 @@ TEST_F(CompositedLayerMappingTest, InterestRectChangeOnViewportScroll) {
EXPECT_RECT_EQ(IntRect(0, 0, 800, 4600),
previousInterestRect(rootScrollingLayer));
- document().view()->setScrollPosition(IntPoint(0, 300), ProgrammaticScroll);
+ document().view()->setScrollOffset(ScrollOffset(0, 300), ProgrammaticScroll);
document().view()->updateAllLifecyclePhases();
// Still use the previous interest rect because the recomputed rect hasn't changed enough.
EXPECT_RECT_EQ(IntRect(0, 0, 800, 4900),
@@ -464,7 +464,7 @@ TEST_F(CompositedLayerMappingTest, InterestRectChangeOnViewportScroll) {
EXPECT_RECT_EQ(IntRect(0, 0, 800, 4600),
previousInterestRect(rootScrollingLayer));
- document().view()->setScrollPosition(IntPoint(0, 600), ProgrammaticScroll);
+ document().view()->setScrollOffset(ScrollOffset(0, 600), ProgrammaticScroll);
document().view()->updateAllLifecyclePhases();
// Use recomputed interest rect because it changed enough.
EXPECT_RECT_EQ(IntRect(0, 0, 800, 5200),
@@ -472,14 +472,14 @@ TEST_F(CompositedLayerMappingTest, InterestRectChangeOnViewportScroll) {
EXPECT_RECT_EQ(IntRect(0, 0, 800, 5200),
previousInterestRect(rootScrollingLayer));
- document().view()->setScrollPosition(IntPoint(0, 5400), ProgrammaticScroll);
+ document().view()->setScrollOffset(ScrollOffset(0, 5400), ProgrammaticScroll);
document().view()->updateAllLifecyclePhases();
EXPECT_RECT_EQ(IntRect(0, 1400, 800, 8600),
recomputeInterestRect(rootScrollingLayer));
EXPECT_RECT_EQ(IntRect(0, 1400, 800, 8600),
previousInterestRect(rootScrollingLayer));
- document().view()->setScrollPosition(IntPoint(0, 9000), ProgrammaticScroll);
+ document().view()->setScrollOffset(ScrollOffset(0, 9000), ProgrammaticScroll);
document().view()->updateAllLifecyclePhases();
// Still use the previous interest rect because it contains the recomputed interest rect.
EXPECT_RECT_EQ(IntRect(0, 5000, 800, 5000),
@@ -487,7 +487,7 @@ TEST_F(CompositedLayerMappingTest, InterestRectChangeOnViewportScroll) {
EXPECT_RECT_EQ(IntRect(0, 1400, 800, 8600),
previousInterestRect(rootScrollingLayer));
- document().view()->setScrollPosition(IntPoint(0, 2000), ProgrammaticScroll);
+ document().view()->setScrollOffset(ScrollOffset(0, 2000), ProgrammaticScroll);
// Use recomputed interest rect because it changed enough.
document().view()->updateAllLifecyclePhases();
EXPECT_RECT_EQ(IntRect(0, 0, 800, 6600),
@@ -689,8 +689,8 @@ TEST_F(CompositedLayerMappingTest, InterestRectOfIframeInScrolledDiv) {
"will-change: transform}</style><div id=target></div>");
// Scroll 8000 pixels down to move the iframe into view.
- document().view()->setScrollPosition(DoublePoint(0.0, 8000.0),
- ProgrammaticScroll);
+ document().view()->setScrollOffset(ScrollOffset(0.0, 8000.0),
+ ProgrammaticScroll);
document().view()->updateAllLifecyclePhases();
Element* target = frameDocument.getElementById("target");
@@ -720,8 +720,8 @@ TEST_F(CompositedLayerMappingTest, InterestRectOfScrolledIframe) {
document().view()->updateAllLifecyclePhases();
// Scroll 7500 pixels down to bring the scrollable area to the bottom.
- frameDocument.view()->setScrollPosition(DoublePoint(0.0, 7500.0),
- ProgrammaticScroll);
+ frameDocument.view()->setScrollOffset(ScrollOffset(0.0, 7500.0),
+ ProgrammaticScroll);
document().view()->updateAllLifecyclePhases();
ASSERT_TRUE(frameDocument.view()->layoutViewItem().hasLayer());
@@ -751,8 +751,8 @@ TEST_F(CompositedLayerMappingTest, InterestRectOfIframeWithContentBoxOffset) {
document().view()->updateAllLifecyclePhases();
// Scroll 3000 pixels down to bring the scrollable area to somewhere in the middle.
- frameDocument.view()->setScrollPosition(DoublePoint(0.0, 3000.0),
- ProgrammaticScroll);
+ frameDocument.view()->setScrollOffset(ScrollOffset(0.0, 3000.0),
+ ProgrammaticScroll);
document().view()->updateAllLifecyclePhases();
ASSERT_TRUE(frameDocument.view()->layoutViewItem().hasLayer());

Powered by Google App Engine
This is Rietveld 408576698