Commit 8cf14874 authored by bokan@chromium.org's avatar bokan@chromium.org

Fixing two layout tests on Android broken by enabling virtual-viewport

The svg test turned out to simply need a rebaseline as the scrollbars should
no longer show up in layout tests.

The autoresize test was off by 1 pixel. This was happening because in
virtual viewport mode we size the main FrameView's width to the content
size and the height by the aspect ratio. This meant that the height would
have some tiny error in some aspect ratios which would get blown up to a
full pixel when we returned an expandedIntSize in
PageScaleConstraintsSet::mainFrameSize. This is fixed by explicitly setting
the FrameView size equal to the viewport size if the content width matches
the viewport width.

BUG=428189

Review URL: https://codereview.chromium.org/699253002

git-svn-id: svn://svn.chromium.org/blink/trunk@184840 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 95799d60
......@@ -252,9 +252,7 @@ crbug.com/395877 [ Mac ] fast/forms/month/month-appearance-l10n.html [ NeedsManu
crbug.com/381684 [ Win Android Mac ] fonts/family-fallback-gardiner.html [ Skip ]
# Failing on Android bots as a result of turning on virtual viewport pinch to zoom.
crbug.com/428189 [ Android ] fast/autoresize/turn-off-autoresize.html [ Failure ]
crbug.com/428189 [ Android ] svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults.xhtml [ Failure ImageOnlyFailure ]
crbug.com/428189 [ Android ] svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults.xhtml [ NeedsRebaseline ]
# Untriaged Mavericks failures
......
......@@ -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)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment