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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2128553002: Make rootScroller the layout viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@viewportScrollCallbackInterface
Patch Set: Rebase + comment fix in test Created 4 years, 5 months 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/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 985302668f0a8ea807e83e05ed286ea613998074..22ba6c0726629a704a0818ec76a9042fa7263423 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -78,6 +78,8 @@
#include "core/page/FocusController.h"
#include "core/page/FrameTree.h"
#include "core/page/Page.h"
+#include "core/page/scrolling/ChildViewportScrollCallback.h"
+#include "core/page/scrolling/RootViewportScrollCallback.h"
#include "core/page/scrolling/ScrollingCoordinator.h"
#include "core/paint/FramePainter.h"
#include "core/paint/PaintLayer.h"
@@ -2392,13 +2394,31 @@ void FrameView::updateDocumentAnnotatedRegions() const
void FrameView::didAttachDocument()
{
+ FrameHost* frameHost = m_frame->host();
+ DCHECK(frameHost);
+
+ DCHECK(m_frame->document());
+
+ ViewportScrollCallback* viewportScrollCallback = nullptr;
+
if (m_frame->isMainFrame()) {
- DCHECK(m_frame->host());
- ScrollableArea& visualViewport = m_frame->host()->visualViewport();
+ ScrollableArea& visualViewport = frameHost->visualViewport();
ScrollableArea* layoutViewport = layoutViewportScrollableArea();
DCHECK(layoutViewport);
- m_viewportScrollableArea = RootFrameViewport::create(visualViewport, *layoutViewport);
+
+ RootFrameViewport* rootFrameViewport =
+ RootFrameViewport::create(visualViewport, *layoutViewport);
+ m_viewportScrollableArea = rootFrameViewport;
+
+ viewportScrollCallback = RootViewportScrollCallback::create(
+ &frameHost->topControls(),
+ &frameHost->overscrollController(),
+ *rootFrameViewport);
+ } else {
+ viewportScrollCallback = ChildViewportScrollCallback::create();
}
+
+ m_frame->document()->initializeRootScroller(viewportScrollCallback);
}
void FrameView::updateScrollCorner()
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/frame/RootFrameViewport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698