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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2184333002: Fix scroll anchoring during viewport resize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment on m_drift 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/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index e8c48f99e348b6bc74b374c9eac82383cb67d4c0..57a36ff60ee965ca464122fed756f98e20fcf355 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -172,7 +172,6 @@
#include "web/SpeechRecognitionClientProxy.h"
#include "web/StorageQuotaClientImpl.h"
#include "web/ValidationMessageClientImpl.h"
-#include "web/ViewportAnchor.h"
#include "web/WebDevToolsAgentImpl.h"
#include "web/WebInputEventConversion.h"
#include "web/WebLocalFrameImpl.h"
@@ -477,6 +476,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebPageVisibilityState visibilit
allInstances().add(this);
m_pageImportanceSignals.setObserver(client);
+ m_resizeViewportAnchor = new ResizeViewportAnchor(*m_page);
}
WebViewImpl::~WebViewImpl()
@@ -1857,7 +1857,7 @@ void WebViewImpl::didUpdateTopControls()
// needed since the top controls adjustment will change the maximum
// scroll offset and we may need to reposition them to keep the user's
// apparent position unchanged.
- ResizeViewportAnchor anchor(*view, visualViewport);
+ ResizeViewportAnchor::ResizeScope resizeScope(*m_resizeViewportAnchor);
float topControlsViewportAdjustment =
topControls().layoutHeight() - topControls().contentOffset();
@@ -1935,7 +1935,7 @@ void WebViewImpl::resizeWithTopControls(const WebSize& newSize, float topControl
RotationViewportAnchor anchor(*view, visualViewport, viewportAnchorCoords, pageScaleConstraintsSet());
resizeViewWhileAnchored(view, topControlsHeight, topControlsShrinkLayout);
} else {
- ResizeViewportAnchor anchor(*view, visualViewport);
+ ResizeViewportAnchor::ResizeScope resizeScope(*m_resizeViewportAnchor);
resizeViewWhileAnchored(view, topControlsHeight, topControlsShrinkLayout);
}
sendResizeEventAndRepaint();
@@ -4051,7 +4051,7 @@ void WebViewImpl::postLayoutResize(WebLocalFrameImpl* webframe)
{
FrameView* view = webframe->frame()->view();
if (webframe == mainFrame())
- view->resize(mainFrameSize());
+ m_resizeViewportAnchor->resizeFrameView(mainFrameSize());
else
view->resize(webframe->frameView()->size());
}
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/Source/web/tests/VisualViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698