OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/page/scrolling/TopDocumentRootScrollerController.h" | 5 #include "core/page/scrolling/TopDocumentRootScrollerController.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
9 #include "core/frame/FrameHost.h" | 9 #include "core/frame/FrameHost.h" |
10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 DEFINE_TRACE(TopDocumentRootScrollerController) { | 35 DEFINE_TRACE(TopDocumentRootScrollerController) { |
36 visitor->trace(m_viewportApplyScroll); | 36 visitor->trace(m_viewportApplyScroll); |
37 visitor->trace(m_globalRootScroller); | 37 visitor->trace(m_globalRootScroller); |
38 visitor->trace(m_page); | 38 visitor->trace(m_page); |
39 } | 39 } |
40 | 40 |
41 void TopDocumentRootScrollerController::didChangeRootScroller() { | 41 void TopDocumentRootScrollerController::didChangeRootScroller() { |
42 recomputeGlobalRootScroller(); | 42 recomputeGlobalRootScroller(); |
43 } | 43 } |
44 | 44 |
45 void TopDocumentRootScrollerController::mainFrameViewResized() { | |
46 Element* rootScroller = globalRootScroller(); | |
47 | |
48 ScrollableArea* area = | |
49 RootScrollerUtil::scrollableAreaForRootScroller(rootScroller); | |
50 | |
51 if (!area) | |
52 return; | |
53 | |
54 if (PaintLayer* layer = area->layer()) { | |
55 layer->setNeedsCompositingInputsUpdate(); | |
56 | |
57 // This is needed if the root scroller is an iframe, since the iframe | |
58 // doesn't have a scrolling/clip layer, its PLC has a container layer that | |
59 // needs to be resized instead. | |
60 layer->compositor()->frameViewDidChangeSize(); | |
61 } | |
62 } | |
63 | |
64 ScrollableArea* TopDocumentRootScrollerController::rootScrollerArea() const { | 45 ScrollableArea* TopDocumentRootScrollerController::rootScrollerArea() const { |
65 return RootScrollerUtil::scrollableAreaForRootScroller(globalRootScroller()); | 46 return RootScrollerUtil::scrollableAreaForRootScroller(globalRootScroller()); |
66 } | 47 } |
67 | 48 |
68 IntSize TopDocumentRootScrollerController::rootScrollerVisibleArea() const { | 49 IntSize TopDocumentRootScrollerController::rootScrollerVisibleArea() const { |
69 if (!topDocument() || !topDocument()->view()) | 50 if (!topDocument() || !topDocument()->view()) |
70 return IntSize(); | 51 return IntSize(); |
71 | 52 |
72 float minimumPageScale = | 53 float minimumPageScale = |
73 m_page->pageScaleConstraintsSet().finalConstraints().minimumScale; | 54 m_page->pageScaleConstraintsSet().finalConstraints().minimumScale; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 204 |
224 PaintLayer* TopDocumentRootScrollerController::rootScrollerPaintLayer() const { | 205 PaintLayer* TopDocumentRootScrollerController::rootScrollerPaintLayer() const { |
225 return RootScrollerUtil::paintLayerForRootScroller(m_globalRootScroller); | 206 return RootScrollerUtil::paintLayerForRootScroller(m_globalRootScroller); |
226 } | 207 } |
227 | 208 |
228 Element* TopDocumentRootScrollerController::globalRootScroller() const { | 209 Element* TopDocumentRootScrollerController::globalRootScroller() const { |
229 return m_globalRootScroller.get(); | 210 return m_globalRootScroller.get(); |
230 } | 211 } |
231 | 212 |
232 } // namespace blink | 213 } // namespace blink |
OLD | NEW |