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

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

Issue 2128553002: Make rootScroller the layout viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@viewportScrollCallbackInterface
Patch Set: Rebase + comment fix in test Created 4 years, 5 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 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 "core/frame/RootFrameViewport.h" 5 #include "core/frame/RootFrameViewport.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/layout/ScrollAlignment.h" 8 #include "core/layout/ScrollAlignment.h"
9 #include "platform/geometry/DoubleRect.h" 9 #include "platform/geometry/DoubleRect.h"
10 #include "platform/geometry/FloatRect.h" 10 #include "platform/geometry/FloatRect.h"
11 #include "platform/geometry/LayoutRect.h" 11 #include "platform/geometry/LayoutRect.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 RootFrameViewport::RootFrameViewport(ScrollableArea& visualViewport, ScrollableA rea& layoutViewport) 15 RootFrameViewport::RootFrameViewport(ScrollableArea& visualViewport, ScrollableA rea& layoutViewport)
16 : m_visualViewport(visualViewport) 16 : m_visualViewport(visualViewport)
17 , m_layoutViewport(layoutViewport) 17 , m_layoutViewport(layoutViewport)
18 { 18 {
19 } 19 }
20 20
21 void RootFrameViewport::setLayoutViewport(ScrollableArea& newLayoutViewport)
22 {
23 m_layoutViewport = &newLayoutViewport;
24 }
25
21 void RootFrameViewport::updateScrollAnimator() 26 void RootFrameViewport::updateScrollAnimator()
22 { 27 {
23 scrollAnimator().setCurrentPosition(toFloatPoint(scrollOffsetFromScrollAnima tors())); 28 scrollAnimator().setCurrentPosition(toFloatPoint(scrollOffsetFromScrollAnima tors()));
24 } 29 }
25 30
26 DoublePoint RootFrameViewport::scrollOffsetFromScrollAnimators() const 31 DoublePoint RootFrameViewport::scrollOffsetFromScrollAnimators() const
27 { 32 {
28 return visualViewport().scrollAnimator().currentPosition() + layoutViewport( ).scrollAnimator().currentPosition(); 33 return visualViewport().scrollAnimator().currentPosition() + layoutViewport( ).scrollAnimator().currentPosition();
29 } 34 }
30 35
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 } 347 }
343 348
344 DEFINE_TRACE(RootFrameViewport) 349 DEFINE_TRACE(RootFrameViewport)
345 { 350 {
346 visitor->trace(m_visualViewport); 351 visitor->trace(m_visualViewport);
347 visitor->trace(m_layoutViewport); 352 visitor->trace(m_layoutViewport);
348 ScrollableArea::trace(visitor); 353 ScrollableArea::trace(visitor);
349 } 354 }
350 355
351 } // namespace blink 356 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698