Index: Source/web/WebViewImpl.cpp |
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
index 572e42bd4c3d09d6e3479a593b63e3b8d3a00b5e..477a43843620c60000da6ab3b1fbd2bc1c2c6702 100644 |
--- a/Source/web/WebViewImpl.cpp |
+++ b/Source/web/WebViewImpl.cpp |
@@ -412,6 +412,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; |
@@ -1661,6 +1662,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) |
@@ -4100,11 +4107,13 @@ void WebViewImpl::updateMainFrameScrollPosition(const IntPoint& scrollPosition, |
frameView->setInProgrammaticScroll(oldProgrammaticScroll); |
} |
-void WebViewImpl::applyScrollAndScale(const WebSize& scrollDelta, float pageScaleDelta) |
+void WebViewImpl::applyViewportDeltas(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. |