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

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

Issue 1611693002: Revert of Don't change layout size due to top control show/hide (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 17424826a5900d818fc4cb0ba8fa7a196d27cb93..0193aed219630e0291ae57305b3d54955c9f3d01 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -1837,14 +1837,7 @@
void WebViewImpl::performResize()
{
- // We'll keep the initial containing block size from changing when the top
- // controls hide so that the ICB will always be the same size as the
- // viewport with the top controls shown.
- IntSize ICBSize = m_size;
- if (!topControls().shrinkViewport())
- ICBSize.expand(0, -topControls().height());
-
- pageScaleConstraintsSet().didChangeInitialContainingBlockSize(ICBSize);
+ pageScaleConstraintsSet().didChangeViewSize(m_size);
updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document()->viewportDescription());
updateMainFrameLayoutSize();
@@ -1925,7 +1918,7 @@
// 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().didChangeInitialContainingBlockSize(m_size);
+ pageScaleConstraintsSet().didChangeViewSize(m_size);
page()->frameHost().visualViewport().setSize(m_size);
return;
}
@@ -3304,11 +3297,7 @@
IntSize WebViewImpl::mainFrameSize()
{
- // The frame size should match the viewport size at minimum scale, since the
- // viewport must always be contained by the frame.
- FloatSize frameSize(m_size);
- frameSize.scale(1 / minimumPageScaleFactor());
- return expandedIntSize(frameSize);
+ return pageScaleConstraintsSet().mainFrameSize();
}
PageScaleConstraintsSet& WebViewImpl::pageScaleConstraintsSet() const
@@ -4111,7 +4100,7 @@
m_size = frameSize;
page()->frameHost().visualViewport().setSize(m_size);
- pageScaleConstraintsSet().didChangeInitialContainingBlockSize(m_size);
+ pageScaleConstraintsSet().didChangeViewSize(m_size);
m_client->didAutoResize(m_size);
sendResizeEventAndRepaint();
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutView.cpp ('k') | third_party/WebKit/Source/web/tests/TopControlsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698