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

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

Issue 2248433002: Viewport resize anchoring should use the current layout viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rootScrollerCompositorWork
Patch Set: Forgot to add test file Created 4 years, 4 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 50137729160c42130d6a2ec3d239691f308eca76..5068c0edcd802112adf2216c77a03f1645863b31 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -819,8 +819,13 @@ void FrameView::performPreLayoutTasks()
m_viewportScrollableArea = RootFrameViewport::create(visualViewport, *layoutViewport);
}
- if (!m_scrollAnchor.hasScroller())
- m_scrollAnchor.setScroller(m_viewportScrollableArea ? m_viewportScrollableArea : this);
+ if (!m_scrollAnchor.hasScroller()) {
+ ScrollableArea* scroller = m_viewportScrollableArea;
+ if (!scroller)
+ scroller = this;
+
+ m_scrollAnchor.setScroller(scroller);
+ }
if (shouldPerformScrollAnchoring())
m_scrollAnchor.save();
@@ -4131,6 +4136,11 @@ ScrollableArea* FrameView::layoutViewportScrollableArea()
return layoutViewItem.isNull() ? nullptr : layoutViewItem.getScrollableArea();
}
+RootFrameViewport* FrameView::getRootFrameViewport()
+{
+ return m_viewportScrollableArea.get();
+}
+
LayoutObject* FrameView::viewportLayoutObject() const
{
if (Document* document = frame().document()) {
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/frame/RootFrameViewport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698