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

Unified Diff: Source/web/PageScaleConstraintsSet.cpp

Issue 643473002: Made top controls work with virtual viewport pinch-to-zoom. (Blink) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
Index: Source/web/PageScaleConstraintsSet.cpp
diff --git a/Source/web/PageScaleConstraintsSet.cpp b/Source/web/PageScaleConstraintsSet.cpp
index 7bdfa3a26556b81745e0e354dc4ad913ea58b22b..d8963d243aeb0ca5a44ee735ee4a0ef8007136bf 100644
--- a/Source/web/PageScaleConstraintsSet.cpp
+++ b/Source/web/PageScaleConstraintsSet.cpp
@@ -149,14 +149,15 @@ IntSize PageScaleConstraintsSet::mainFrameSize(const IntSize& contentsSize) cons
if (m_pageDefinedConstraints.minimumScale < finalConstraints().minimumScale
&& m_userAgentConstraints.minimumScale < finalConstraints().minimumScale
&& contentsSize.width()
- && m_viewSize.width())
- return IntSize(contentsSize.width(), computeHeightByAspectRatio(contentsSize.width(), m_viewSize));
+ && m_viewSize.width()) {
+ return expandedIntSize(FloatSize(contentsSize.width(), computeHeightByAspectRatio(contentsSize.width(), m_viewSize)));
+ }
// If there is a minimum scale (or there's no content size yet), the frame size should match the viewport
// size at minimum scale, since the viewport must always be contained by the frame.
- IntSize frameSize(m_viewSize);
+ FloatSize frameSize(m_viewSize);
frameSize.scale(1 / finalConstraints().minimumScale);
- return frameSize;
+ return expandedIntSize(frameSize);
}
void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescription& description, int layoutFallbackWidth, float deviceScaleFactor, bool supportTargetDensityDPI, bool wideViewportQuirkEnabled, bool useWideViewport, bool loadWithOverviewMode, bool nonUserScalableQuirkEnabled)

Powered by Google App Engine
This is Rietveld 408576698