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

Unified Diff: third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp

Issue 2501723003: Disable scrollbars on the root scroller when using visual viewport scrollbars. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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 bb4678bd4c97637523f0ed2c4364401b3b39f0df..beb0947540e0a1720e831276368cfd356c1d0379 100644
--- a/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
@@ -114,6 +114,11 @@ void TopDocumentRootScrollerController::recomputeGlobalRootScroller() {
// changes.
setNeedsCompositingInputsUpdateOnGlobalRootScroller();
+ ScrollableArea* oldRootScrollerArea =
+ m_globalRootScroller
+ ? RootScrollerUtil::scrollableAreaFor(*m_globalRootScroller.get())
+ : nullptr;
+
m_globalRootScroller = target;
setNeedsCompositingInputsUpdateOnGlobalRootScroller();
@@ -124,6 +129,13 @@ void TopDocumentRootScrollerController::recomputeGlobalRootScroller() {
// ViewportScrollCallback to swap the target into the layout viewport
// in RootFrameViewport.
m_viewportApplyScroll->setScroller(targetScroller);
+
+ // The scrollers may need to stop using their own scrollbars as Android
+ // Chrome's VisualViewport provides the scrollbars for the root scroller.
+ if (oldRootScrollerArea)
+ oldRootScrollerArea->didChangeGlobalRootScroller();
+
+ targetScroller->didChangeGlobalRootScroller();
}
Document* TopDocumentRootScrollerController::topDocument() const {

Powered by Google App Engine
This is Rietveld 408576698