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

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

Issue 1568383002: Preserve page resize information when main frame is remote (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small tweak to width comparison in setSize Created 4 years, 11 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 7be5f1006676c7800988794aeae343f3fe494fa6..1cc400e66b4c5ae75a95c91ad45cce6e516e14bc 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -1902,13 +1902,12 @@ TopControls& WebViewImpl::topControls()
void WebViewImpl::resizeViewWhileAnchored(FrameView* view)
{
- // FIXME: TextAutosizer does not yet support out-of-process frames.
- if (mainFrameImpl() && mainFrameImpl()->frame()->isLocalFrame()) {
+ ASSERT(mainFrameImpl() && mainFrameImpl()->frame()->isLocalFrame());
+
+ {
// Avoids unnecessary invalidations while various bits of state in TextAutosizer are updated.
TextAutosizer::DeferUpdatePageInfo deferUpdatePageInfo(page());
performResize();
- } else {
- performResize();
}
m_fullscreenController->updateSize();
@@ -1923,6 +1922,17 @@ void WebViewImpl::resize(const WebSize& newSize)
if (m_shouldAutoResize || m_size == newSize)
return;
+ if (page()->mainFrame() && !page()->mainFrame()->isLocalFrame()) {
+ // Viewport resize for a remote main frame does not require any
+ // particular action, but the state needs to reflect the correct size
+ // so that it can be used for initalization if the main frame gets
+ // swapped to a LocalFrame at a later time.
+ m_size = newSize;
+ pageScaleConstraintsSet().didChangeViewSize(m_size);
+ page()->frameHost().visualViewport().setSize(m_size);
+ return;
+ }
+
WebLocalFrameImpl* mainFrame = mainFrameImpl();
if (!mainFrame)
return;
« no previous file with comments | « third_party/WebKit/Source/core/frame/VisualViewport.cpp ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698