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

Side by Side Diff: third_party/WebKit/Source/core/frame/RootFrameViewportTest.cpp

Issue 2383113003: Refactor ScrollableArea::setScrollPosition. (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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/RootFrameViewport.h" 5 #include "core/frame/RootFrameViewport.h"
6 6
7 #include "core/layout/ScrollAlignment.h" 7 #include "core/layout/ScrollAlignment.h"
8 #include "platform/geometry/DoubleRect.h" 8 #include "platform/geometry/DoubleRect.h"
9 #include "platform/geometry/LayoutRect.h" 9 #include "platform/geometry/LayoutRect.h"
10 #include "platform/scroll/ScrollableArea.h" 10 #include "platform/scroll/ScrollableArea.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 DEFINE_INLINE_VIRTUAL_TRACE() { ScrollableArea::trace(visitor); } 72 DEFINE_INLINE_VIRTUAL_TRACE() { ScrollableArea::trace(visitor); }
73 73
74 protected: 74 protected:
75 ScrollableAreaStub(const IntSize& viewportSize, const IntSize& contentsSize) 75 ScrollableAreaStub(const IntSize& viewportSize, const IntSize& contentsSize)
76 : m_userInputScrollableX(true), 76 : m_userInputScrollableX(true),
77 m_userInputScrollableY(true), 77 m_userInputScrollableY(true),
78 m_viewportSize(viewportSize), 78 m_viewportSize(viewportSize),
79 m_contentsSize(contentsSize) {} 79 m_contentsSize(contentsSize) {}
80 80
81 void setScrollOffset(const DoublePoint& offset, ScrollType) override { 81 void updateScrollPosition(const DoublePoint& offset, ScrollType) override {
82 m_scrollPosition = offset; 82 m_scrollPosition = offset;
83 } 83 }
84 bool shouldUseIntegerScrollOffset() const override { return true; } 84 bool shouldUseIntegerScrollOffset() const override { return true; }
85 LayoutRect visualRectForScrollbarParts() const override { 85 LayoutRect visualRectForScrollbarParts() const override {
86 ASSERT_NOT_REACHED(); 86 ASSERT_NOT_REACHED();
87 return LayoutRect(); 87 return LayoutRect();
88 } 88 }
89 bool isActive() const override { return true; } 89 bool isActive() const override { return true; }
90 bool isScrollCornerVisible() const override { return true; } 90 bool isScrollCornerVisible() const override { return true; }
91 IntRect scrollCornerRect() const override { return IntRect(); } 91 IntRect scrollCornerRect() const override { return IntRect(); }
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 alternateScroller->scrollPositionDouble()); 510 alternateScroller->scrollPositionDouble());
511 EXPECT_POINT_EQ(DoublePoint(200, 200), 511 EXPECT_POINT_EQ(DoublePoint(200, 200),
512 rootFrameViewport->scrollPositionDouble()); 512 rootFrameViewport->scrollPositionDouble());
513 EXPECT_POINT_EQ(DoublePoint(50, 50), layoutViewport->scrollPositionDouble()); 513 EXPECT_POINT_EQ(DoublePoint(50, 50), layoutViewport->scrollPositionDouble());
514 514
515 EXPECT_POINT_EQ(DoublePoint(550, 450), 515 EXPECT_POINT_EQ(DoublePoint(550, 450),
516 rootFrameViewport->maximumScrollPositionDouble()); 516 rootFrameViewport->maximumScrollPositionDouble());
517 } 517 }
518 518
519 } // namespace blink 519 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698