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

Unified Diff: Source/web/PageScaleConstraintsSet.cpp

Issue 699253002: Fixing two layout tests on Android broken by enabling virtual-viewport (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use viewportHeight if contentWidth == viewportWidth Created 6 years, 1 month 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 | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/PageScaleConstraintsSet.cpp
diff --git a/Source/web/PageScaleConstraintsSet.cpp b/Source/web/PageScaleConstraintsSet.cpp
index ebb42ad6bf2d33161e95de6df182eb7cc6157da9..113517d557b0ac4c2f8c4c8e8b1ca9d7e95869d7 100644
--- a/Source/web/PageScaleConstraintsSet.cpp
+++ b/Source/web/PageScaleConstraintsSet.cpp
@@ -150,6 +150,12 @@ IntSize PageScaleConstraintsSet::mainFrameSize(int contentWidthIncludingScrollba
&& m_userAgentConstraints.minimumScale < finalConstraints().minimumScale
&& contentWidthIncludingScrollbar
&& m_viewSize.width()) {
+
+ // Special case where the contents are exactly as wide as the viewport to prevent an off-by-one due
+ // to floating point imprecision in the aspect ratio height calculation.
+ if (contentWidthIncludingScrollbar == m_viewSize.width())
+ return m_viewSize;
+
return expandedIntSize(FloatSize(
contentWidthIncludingScrollbar,
computeHeightByAspectRatio(contentWidthIncludingScrollbar, m_viewSize)));
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698