Index: third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp |
diff --git a/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp b/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp |
index 1f0519209343c98598648bb3c014ddc4c4081846..270b7c55e2408516c9bd21a83341f8c5482ecfc3 100644 |
--- a/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp |
+++ b/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp |
@@ -8,6 +8,8 @@ |
#include "core/dom/Element.h" |
#include "core/frame/FrameHost.h" |
#include "core/frame/FrameView.h" |
+#include "core/frame/PageScaleConstraintsSet.h" |
+#include "core/frame/VisualViewport.h" |
#include "core/html/HTMLFrameOwnerElement.h" |
#include "core/layout/LayoutView.h" |
#include "core/layout/compositing/PaintLayerCompositor.h" |
@@ -60,6 +62,24 @@ void TopDocumentRootScrollerController::mainFrameViewResized() { |
} |
} |
+ScrollableArea* TopDocumentRootScrollerController::rootScrollerArea() const { |
+ return RootScrollerUtil::scrollableAreaForRootScroller(globalRootScroller()); |
+} |
+ |
+IntSize TopDocumentRootScrollerController::rootScrollerVisibleArea() const { |
+ if (!topDocument() || !topDocument()->view()) |
+ return IntSize(); |
+ |
+ float minimumPageScale = |
+ m_frameHost->pageScaleConstraintsSet().finalConstraints().minimumScale; |
+ int browserControlsAdjustment = |
+ ceilf(m_frameHost->visualViewport().browserControlsAdjustment() / |
+ minimumPageScale); |
+ |
+ return topDocument()->view()->visibleContentSize(ExcludeScrollbars) + |
+ IntSize(0, browserControlsAdjustment); |
+} |
+ |
Element* TopDocumentRootScrollerController::findGlobalRootScrollerElement() { |
if (!topDocument()) |
return nullptr; |