| 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/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/PageScaleConstraintsSet.h" | 10 #include "core/frame/PageScaleConstraintsSet.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 IntSize TopDocumentRootScrollerController::RootScrollerVisibleArea() const { | 62 IntSize TopDocumentRootScrollerController::RootScrollerVisibleArea() const { |
| 63 if (!TopDocument() || !TopDocument()->View()) | 63 if (!TopDocument() || !TopDocument()->View()) |
| 64 return IntSize(); | 64 return IntSize(); |
| 65 | 65 |
| 66 float minimum_page_scale = | 66 float minimum_page_scale = |
| 67 page_->GetPageScaleConstraintsSet().FinalConstraints().minimum_scale; | 67 page_->GetPageScaleConstraintsSet().FinalConstraints().minimum_scale; |
| 68 int browser_controls_adjustment = | 68 int browser_controls_adjustment = |
| 69 ceilf(page_->GetVisualViewport().BrowserControlsAdjustment() / | 69 ceilf(page_->GetVisualViewport().BrowserControlsAdjustment() / |
| 70 minimum_page_scale); | 70 minimum_page_scale); |
| 71 | 71 |
| 72 return TopDocument()->View()->VisibleContentSize(kExcludeScrollbars) + | 72 return TopDocument() |
| 73 ->View() |
| 74 ->LayoutViewportScrollableArea() |
| 75 ->VisibleContentRect(kExcludeScrollbars) |
| 76 .Size() + |
| 73 IntSize(0, browser_controls_adjustment); | 77 IntSize(0, browser_controls_adjustment); |
| 74 } | 78 } |
| 75 | 79 |
| 76 Element* TopDocumentRootScrollerController::FindGlobalRootScrollerElement() { | 80 Element* TopDocumentRootScrollerController::FindGlobalRootScrollerElement() { |
| 77 if (!TopDocument()) | 81 if (!TopDocument()) |
| 78 return nullptr; | 82 return nullptr; |
| 79 | 83 |
| 80 Node* effective_root_scroller = | 84 Node* effective_root_scroller = |
| 81 &TopDocument()->GetRootScrollerController().EffectiveRootScroller(); | 85 &TopDocument()->GetRootScrollerController().EffectiveRootScroller(); |
| 82 | 86 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 227 |
| 224 PaintLayer* TopDocumentRootScrollerController::RootScrollerPaintLayer() const { | 228 PaintLayer* TopDocumentRootScrollerController::RootScrollerPaintLayer() const { |
| 225 return RootScrollerUtil::PaintLayerForRootScroller(global_root_scroller_); | 229 return RootScrollerUtil::PaintLayerForRootScroller(global_root_scroller_); |
| 226 } | 230 } |
| 227 | 231 |
| 228 Element* TopDocumentRootScrollerController::GlobalRootScroller() const { | 232 Element* TopDocumentRootScrollerController::GlobalRootScroller() const { |
| 229 return global_root_scroller_.Get(); | 233 return global_root_scroller_.Get(); |
| 230 } | 234 } |
| 231 | 235 |
| 232 } // namespace blink | 236 } // namespace blink |
| OLD | NEW |