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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 560623002: Adjust maximum scroll bounds on FrameView to account for top controls. (Blink-side) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review feedback Created 6 years, 3 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: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index ed67d3c13a51a80ff78c4f222a4cc9401e4a4ea7..b113fe7b878e596735b932ef7abc349617afc711 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -414,6 +414,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_zoomFactorOverride(0)
, m_userGestureObserved(false)
, m_topControlsContentOffset(0)
+ , m_topControlsLayoutHeight(0)
{
Page::PageClients pageClients;
pageClients.chromeClient = &m_chromeClientImpl;
@@ -1666,6 +1667,27 @@ void WebViewImpl::setTopControlsContentOffset(float offset)
{
m_topControlsContentOffset = offset;
m_layerTreeView->setTopControlsContentOffset(offset);
+ didUpdateTopControls();
+}
+
+void WebViewImpl::setTopControlsLayoutHeight(float height)
+{
+ m_topControlsLayoutHeight = height;
+ didUpdateTopControls();
+}
+
+void WebViewImpl::didUpdateTopControls()
+{
+ FrameView* view = localFrameRootTemporary()->frameView();
+ if (!view)
+ return;
+
+ // The viewport bounds were adjusted on the compositor by this much due to top controls. Tell
+ // the FrameView about it so it can make correct scroll offset clamping decisions during compositor
+ // commits.
+ // FIXME(bokan) Reenable once Chromium side lands.
+ // float topControlsViewportAdjustment = m_topControlsContentOffset - m_topControlsLayoutHeight;
+ // view->setTopControlsViewportAdjustment(topControlsViewportAdjustment);
}
void WebViewImpl::resize(const WebSize& newSize)

Powered by Google App Engine
This is Rietveld 408576698