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

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: Replace the layout viewport with the root scroller 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 921b854f22b0037ef43cc99a0c105a8577fe9457..bfc88993576a45c02fb7b9098406b9b4f60aec12 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"
@@ -2388,13 +2390,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()

Powered by Google App Engine
This is Rietveld 408576698