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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 663993003: Don't calculate a top controls adjustment if pinch viewport size is uninitialized. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Feedback Created 6 years, 2 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 | « no previous file | Source/wtf/MathExtras.h » ('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 bb5da5197c3c6a016ec05a928e8a3939831f8384..4b9c315bd4bfc09fc62e3e59114174d0ae8b1d2a 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -1687,6 +1687,9 @@ void WebViewImpl::performResize()
if (pinchVirtualViewportEnabled())
page()->frameHost().pinchViewport().setSize(m_size);
+ // In case we didn't have a size when the top controls were updated.
+ didUpdateTopControls();
+
// 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,
@@ -1729,6 +1732,10 @@ void WebViewImpl::didUpdateTopControls()
view->setTopControlsViewportAdjustment(topControlsViewportAdjustment);
} else {
PinchViewport& pinchViewport = page()->frameHost().pinchViewport();
+
+ if (pinchViewport.visibleRect().isEmpty())
+ return;
+
pinchViewport.setTopControlsAdjustment(topControlsViewportAdjustment);
// Shrink the FrameView by the amount that will maintain the aspect-ratio with the PinchViewport.
« no previous file with comments | « no previous file | Source/wtf/MathExtras.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698