| OLD | NEW |
| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "core/frame/RootFrameViewport.h" | 7 #include "core/frame/RootFrameViewport.h" |
| 8 | 8 |
| 9 #include "core/layout/ScrollAlignment.h" | 9 #include "core/layout/ScrollAlignment.h" |
| 10 #include "platform/geometry/DoubleRect.h" | 10 #include "platform/geometry/DoubleRect.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 void setScrollOffset(const IntPoint& offset, ScrollType) override { m_scroll
Position = offset; } | 83 void setScrollOffset(const IntPoint& offset, ScrollType) override { m_scroll
Position = offset; } |
| 84 void setScrollOffset(const DoublePoint& offset, ScrollType) override { m_scr
ollPosition = offset; } | 84 void setScrollOffset(const DoublePoint& offset, ScrollType) override { m_scr
ollPosition = offset; } |
| 85 bool shouldUseIntegerScrollOffset() const override { return true; } | 85 bool shouldUseIntegerScrollOffset() const override { return true; } |
| 86 bool isActive() const override { return true; } | 86 bool isActive() const override { return true; } |
| 87 bool isScrollCornerVisible() const override { return true; } | 87 bool isScrollCornerVisible() const override { return true; } |
| 88 IntRect scrollCornerRect() const override { return IntRect(); } | 88 IntRect scrollCornerRect() const override { return IntRect(); } |
| 89 bool scrollbarsCanBeActive() const override { return true; } | 89 bool scrollbarsCanBeActive() const override { return true; } |
| 90 IntRect scrollableAreaBoundingBox() const override { return IntRect(); } | 90 IntRect scrollableAreaBoundingBox() const override { return IntRect(); } |
| 91 bool shouldPlaceVerticalScrollbarOnLeft() const override { return true; } | 91 bool shouldPlaceVerticalScrollbarOnLeft() const override { return true; } |
| 92 void scrollControlWasSetNeedsPaintInvalidation() override { } | 92 void invalidateScrollbarRect(Scrollbar*, const IntRect&) override { } |
| 93 void invalidateScrollCornerRect(const IntRect&) override { } |
| 93 GraphicsLayer* layerForContainer() const override { return nullptr; } | 94 GraphicsLayer* layerForContainer() const override { return nullptr; } |
| 94 GraphicsLayer* layerForScrolling() const override { return nullptr; } | 95 GraphicsLayer* layerForScrolling() const override { return nullptr; } |
| 95 GraphicsLayer* layerForHorizontalScrollbar() const override { return nullptr
; } | 96 GraphicsLayer* layerForHorizontalScrollbar() const override { return nullptr
; } |
| 96 GraphicsLayer* layerForVerticalScrollbar() const override { return nullptr;
} | 97 GraphicsLayer* layerForVerticalScrollbar() const override { return nullptr;
} |
| 97 bool userInputScrollable(ScrollbarOrientation orientation) const override | 98 bool userInputScrollable(ScrollbarOrientation orientation) const override |
| 98 { | 99 { |
| 99 return orientation == HorizontalScrollbar ? m_userInputScrollableX : m_u
serInputScrollableY; | 100 return orientation == HorizontalScrollbar ? m_userInputScrollableX : m_u
serInputScrollableY; |
| 100 } | 101 } |
| 101 | 102 |
| 102 DoublePoint clampedScrollOffset(const DoublePoint& offset) | 103 DoublePoint clampedScrollOffset(const DoublePoint& offset) |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 rootFrameViewport->setScrollPosition(DoublePoint(40, 40), UserScroll); | 490 rootFrameViewport->setScrollPosition(DoublePoint(40, 40), UserScroll); |
| 490 EXPECT_POINT_EQ(DoublePoint(40, 40), visualViewport->scrollPositionDouble())
; | 491 EXPECT_POINT_EQ(DoublePoint(40, 40), visualViewport->scrollPositionDouble())
; |
| 491 EXPECT_POINT_EQ(DoublePoint(0, 0), layoutViewport->scrollPositionDouble()); | 492 EXPECT_POINT_EQ(DoublePoint(0, 0), layoutViewport->scrollPositionDouble()); |
| 492 | 493 |
| 493 rootFrameViewport->setScrollPosition(DoublePoint(60, 60), ProgrammaticScroll
); | 494 rootFrameViewport->setScrollPosition(DoublePoint(60, 60), ProgrammaticScroll
); |
| 494 EXPECT_POINT_EQ(DoublePoint(50, 50), visualViewport->scrollPositionDouble())
; | 495 EXPECT_POINT_EQ(DoublePoint(50, 50), visualViewport->scrollPositionDouble())
; |
| 495 EXPECT_POINT_EQ(DoublePoint(10, 10), layoutViewport->scrollPositionDouble())
; | 496 EXPECT_POINT_EQ(DoublePoint(10, 10), layoutViewport->scrollPositionDouble())
; |
| 496 } | 497 } |
| 497 | 498 |
| 498 } // namespace blink | 499 } // namespace blink |
| OLD | NEW |