| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 ScrollableArea* TopDocumentRootScrollerController::rootScrollerArea() const { | 64 ScrollableArea* TopDocumentRootScrollerController::rootScrollerArea() const { |
| 65 return RootScrollerUtil::scrollableAreaForRootScroller(globalRootScroller()); | 65 return RootScrollerUtil::scrollableAreaForRootScroller(globalRootScroller()); |
| 66 } | 66 } |
| 67 | 67 |
| 68 IntSize TopDocumentRootScrollerController::rootScrollerVisibleArea() const { | 68 IntSize TopDocumentRootScrollerController::rootScrollerVisibleArea() const { |
| 69 if (!topDocument() || !topDocument()->view()) | 69 if (!topDocument() || !topDocument()->view()) |
| 70 return IntSize(); | 70 return IntSize(); |
| 71 | 71 |
| 72 float minimumPageScale = | 72 float minimumPageScale = |
| 73 m_page->pageScaleConstraintsSet().finalConstraints().minimumScale; | 73 m_page->pageScaleConstraintsSet().finalConstraints().minimumScale; |
| 74 int browserControlsAdjustment = | 74 int browserControlsAdjustment = ceilf( |
| 75 ceilf(m_page->frameHost().visualViewport().browserControlsAdjustment() / | 75 m_page->visualViewport().browserControlsAdjustment() / minimumPageScale); |
| 76 minimumPageScale); | |
| 77 | 76 |
| 78 return topDocument()->view()->visibleContentSize(ExcludeScrollbars) + | 77 return topDocument()->view()->visibleContentSize(ExcludeScrollbars) + |
| 79 IntSize(0, browserControlsAdjustment); | 78 IntSize(0, browserControlsAdjustment); |
| 80 } | 79 } |
| 81 | 80 |
| 82 Element* TopDocumentRootScrollerController::findGlobalRootScrollerElement() { | 81 Element* TopDocumentRootScrollerController::findGlobalRootScrollerElement() { |
| 83 if (!topDocument()) | 82 if (!topDocument()) |
| 84 return nullptr; | 83 return nullptr; |
| 85 | 84 |
| 86 Node* effectiveRootScroller = | 85 Node* effectiveRootScroller = |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 | 251 |
| 253 PaintLayer* TopDocumentRootScrollerController::rootScrollerPaintLayer() const { | 252 PaintLayer* TopDocumentRootScrollerController::rootScrollerPaintLayer() const { |
| 254 return RootScrollerUtil::paintLayerForRootScroller(m_globalRootScroller); | 253 return RootScrollerUtil::paintLayerForRootScroller(m_globalRootScroller); |
| 255 } | 254 } |
| 256 | 255 |
| 257 Element* TopDocumentRootScrollerController::globalRootScroller() const { | 256 Element* TopDocumentRootScrollerController::globalRootScroller() const { |
| 258 return m_globalRootScroller.get(); | 257 return m_globalRootScroller.get(); |
| 259 } | 258 } |
| 260 | 259 |
| 261 } // namespace blink | 260 } // namespace blink |
| OLD | NEW |