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. |