| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 virtual void invalidateScrollCornerRect(const IntRect&) override { } | 140 virtual void invalidateScrollCornerRect(const IntRect&) override { } |
| 141 virtual bool userInputScrollable(ScrollbarOrientation) const override { retu
rn true; } | 141 virtual bool userInputScrollable(ScrollbarOrientation) const override { retu
rn true; } |
| 142 virtual bool shouldPlaceVerticalScrollbarOnLeft() const override { return fa
lse; } | 142 virtual bool shouldPlaceVerticalScrollbarOnLeft() const override { return fa
lse; } |
| 143 virtual int pageStep(ScrollbarOrientation) const override { return 0; } | 143 virtual int pageStep(ScrollbarOrientation) const override { return 0; } |
| 144 virtual IntPoint minimumScrollPosition() const override { return IntPoint();
} | 144 virtual IntPoint minimumScrollPosition() const override { return IntPoint();
} |
| 145 virtual IntPoint maximumScrollPosition() const override | 145 virtual IntPoint maximumScrollPosition() const override |
| 146 { | 146 { |
| 147 return IntPoint(contentsSize().width() - visibleWidth(), contentsSize().
height() - visibleHeight()); | 147 return IntPoint(contentsSize().width() - visibleWidth(), contentsSize().
height() - visibleHeight()); |
| 148 } | 148 } |
| 149 | 149 |
| 150 virtual void setScrollOffset(const IntPoint& scrollOffset) override { m_scro
llPosition = scrollOffset; } | 150 virtual void setScrollOffset(const IntPoint& scrollOffset, ScrollType) overr
ide { m_scrollPosition = scrollOffset; } |
| 151 virtual void setScrollOffset(const DoublePoint& scrollOffset) override { m_s
crollPosition = scrollOffset; } | 151 virtual void setScrollOffset(const DoublePoint& scrollOffset, ScrollType) ov
erride { m_scrollPosition = scrollOffset; } |
| 152 virtual DoublePoint scrollPositionDouble() const override { return m_scrollP
osition; } | 152 virtual DoublePoint scrollPositionDouble() const override { return m_scrollP
osition; } |
| 153 virtual IntPoint scrollPosition() const override { return flooredIntPoint(m_
scrollPosition); } | 153 virtual IntPoint scrollPosition() const override { return flooredIntPoint(m_
scrollPosition); } |
| 154 | 154 |
| 155 private: | 155 private: |
| 156 DoublePoint m_scrollPosition; | 156 DoublePoint m_scrollPosition; |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 TEST_F(GraphicsLayerTest, applyScrollToScrollableArea) | 159 TEST_F(GraphicsLayerTest, applyScrollToScrollableArea) |
| 160 { | 160 { |
| 161 FakeScrollableArea scrollableArea; | 161 FakeScrollableArea scrollableArea; |
| 162 m_graphicsLayer->setScrollableArea(&scrollableArea, false); | 162 m_graphicsLayer->setScrollableArea(&scrollableArea, false); |
| 163 | 163 |
| 164 WebDoublePoint scrollPosition(7, 9); | 164 WebDoublePoint scrollPosition(7, 9); |
| 165 m_platformLayer->setScrollPositionDouble(scrollPosition); | 165 m_platformLayer->setScrollPositionDouble(scrollPosition); |
| 166 m_graphicsLayer->didScroll(); | 166 m_graphicsLayer->didScroll(); |
| 167 | 167 |
| 168 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea.scrollPositionDouble().x())
; | 168 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea.scrollPositionDouble().x())
; |
| 169 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea.scrollPositionDouble().y())
; | 169 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea.scrollPositionDouble().y())
; |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace | 172 } // namespace |
| OLD | NEW |