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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 911083002: Carry out a resize even if no layout has been performed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Minor changes in unit test Created 5 years, 10 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
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 9d314fb083d8c013b0979c995412fab2c297abae..c4553267a604f402441d7979295d69c9399c70b8 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -1693,6 +1693,11 @@ void WebViewImpl::performResize()
if (pinchVirtualViewportEnabled())
page()->frameHost().pinchViewport().setSize(m_size);
+ if (mainFrameImpl()->frameView()) {
+ if (!mainFrameImpl()->frameView()->needsLayout())
+ postLayoutResize(mainFrameImpl());
+ }
+
// When device emulation is enabled, device size values may change - they are
// usually set equal to the view size. These values are not considered viewport-dependent
// (see MediaQueryExp::isViewportDependent), since they are only viewport-dependent in emulation mode,
@@ -4013,6 +4018,18 @@ void WebViewImpl::resumeTreeViewCommits()
}
}
+void WebViewImpl::postLayoutResize(WebLocalFrameImpl* webframe)
+{
+ FrameView* view = webframe->frame()->view();
+ if (pinchVirtualViewportEnabled()) {
+ if (webframe == mainFrame()) {
+ view->resize(mainFrameSize());
+ } else {
+ view->resize(webframe->frameView()->layoutSize());
+ }
+ }
+}
+
void WebViewImpl::layoutUpdated(WebLocalFrameImpl* webframe)
{
if (!m_client || !webframe->frame()->isLocalRoot())
@@ -4040,13 +4057,7 @@ void WebViewImpl::layoutUpdated(WebLocalFrameImpl* webframe)
FrameView* view = webframe->frame()->view();
- if (pinchVirtualViewportEnabled()) {
- if (webframe == mainFrame()) {
- view->resize(mainFrameSize());
- } else {
- view->resize(webframe->frameView()->layoutSize());
- }
- }
+ postLayoutResize(webframe);
// Relayout immediately to avoid violating the rule that needsLayout()
// isn't set at the end of a layout.
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698