OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "core/frame/RootFrameViewport.h" | 6 #include "core/frame/RootFrameViewport.h" |
7 | 7 |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
9 #include "core/layout/ScrollAlignment.h" | 9 #include "core/layout/ScrollAlignment.h" |
10 #include "platform/geometry/DoubleRect.h" | 10 #include "platform/geometry/DoubleRect.h" |
11 #include "platform/geometry/FloatRect.h" | 11 #include "platform/geometry/FloatRect.h" |
12 #include "platform/geometry/LayoutRect.h" | 12 #include "platform/geometry/LayoutRect.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 RootFrameViewport::RootFrameViewport(ScrollableArea& visualViewport, ScrollableA
rea& layoutViewport) | 16 RootFrameViewport::RootFrameViewport(ScrollableArea& visualViewport, ScrollableA
rea& layoutViewport) |
17 : m_visualViewport(visualViewport) | 17 : m_visualViewport(visualViewport) |
18 , m_layoutViewport(layoutViewport) | 18 , m_layoutViewport(layoutViewport) |
19 { | 19 { |
20 } | 20 } |
21 | 21 |
22 DEFINE_TRACE(RootFrameViewport) | |
23 { | |
24 visitor->trace(m_visualViewport); | |
25 visitor->trace(m_layoutViewport); | |
26 } | |
27 | |
28 void RootFrameViewport::updateScrollAnimator() | 22 void RootFrameViewport::updateScrollAnimator() |
29 { | 23 { |
30 scrollAnimator()->setCurrentPosition(toFloatPoint(scrollOffsetFromScrollAnim
ators())); | 24 scrollAnimator()->setCurrentPosition(toFloatPoint(scrollOffsetFromScrollAnim
ators())); |
31 } | 25 } |
32 | 26 |
33 DoublePoint RootFrameViewport::scrollOffsetFromScrollAnimators() const | 27 DoublePoint RootFrameViewport::scrollOffsetFromScrollAnimators() const |
34 { | 28 { |
35 return visualViewport().scrollAnimator()->currentPosition() + layoutViewport
().scrollAnimator()->currentPosition(); | 29 return visualViewport().scrollAnimator()->currentPosition() + layoutViewport
().scrollAnimator()->currentPosition(); |
36 } | 30 } |
37 | 31 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 if (visualViewport().userInputScrollable(orientation)) | 293 if (visualViewport().userInputScrollable(orientation)) |
300 return visualViewport().scroll(direction, granularity, delta); | 294 return visualViewport().scroll(direction, granularity, delta); |
301 | 295 |
302 if (layoutViewport().userInputScrollable(orientation)) | 296 if (layoutViewport().userInputScrollable(orientation)) |
303 return layoutViewport().scroll(direction, granularity, delta); | 297 return layoutViewport().scroll(direction, granularity, delta); |
304 | 298 |
305 return false; | 299 return false; |
306 } | 300 } |
307 | 301 |
308 } // namespace blink | 302 } // namespace blink |
OLD | NEW |