Index: Source/web/WebViewImpl.cpp |
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
index a95346118a8a53bb327cf1173dcb3b3895635900..4fdab03b9aabaa93bbad2f40059d8c858b8bc294 100644 |
--- a/Source/web/WebViewImpl.cpp |
+++ b/Source/web/WebViewImpl.cpp |
@@ -410,6 +410,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) |
, m_backgroundColorOverride(Color::transparent) |
, m_zoomFactorOverride(0) |
, m_userGestureObserved(false) |
+ , m_topControlsContentOffset(0) |
{ |
Page::PageClients pageClients; |
pageClients.chromeClient = &m_chromeClientImpl; |
@@ -1654,6 +1655,12 @@ void WebViewImpl::performResize() |
} |
} |
+void WebViewImpl::setTopControlsContentOffset(float offset) |
+{ |
+ m_topControlsContentOffset = offset; |
+ m_layerTreeView->setTopControlsContentOffset(offset); |
+} |
+ |
void WebViewImpl::resize(const WebSize& newSize) |
{ |
if (m_shouldAutoResize || m_size == newSize) |
@@ -4094,11 +4101,13 @@ void WebViewImpl::updateMainFrameScrollPosition(const IntPoint& scrollPosition, |
frameView->setInProgrammaticScroll(oldProgrammaticScroll); |
} |
-void WebViewImpl::applyScrollAndScale(const WebSize& scrollDelta, float pageScaleDelta) |
+void WebViewImpl::applyViewportProperties(const WebSize& scrollDelta, float pageScaleDelta, float topControlsDelta) |
{ |
if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
return; |
+ setTopControlsContentOffset(m_topControlsContentOffset + topControlsDelta); |
+ |
if (pinchVirtualViewportEnabled()) { |
if (pageScaleDelta != 1) { |
// When the virtual viewport is enabled, offsets are already set for us. |