Bug 942799 - Respect height=device-height in meta viewport tag on B2G. r=mbrubeck,ehsan

This commit is contained in:
Botond Ballo 2013-11-26 18:55:27 -05:00
parent 4bbd7de7db
commit c25fc745e8

View File

@ -554,11 +554,6 @@ TabChild::HandlePossibleViewportChange()
return;
}
// Make sure the viewport height is not shorter than the window when the page
// is zoomed out to show its full width. Note that before we set the viewport
// width, the "full width" of the page isn't properly defined, so that's why
// we have to call SetCSSViewport twice - once to set the width, and the
// second time to figure out the height based on the layout at that width.
float oldBrowserWidth = mOldViewportWidth;
mLastMetrics.mViewport.SizeTo(viewport);
if (!oldBrowserWidth) {
@ -606,13 +601,6 @@ TabChild::HandlePossibleViewportChange()
return;
}
CSSToScreenScale minScale(mInnerSize.width / pageSize.width);
minScale = clamped(minScale, viewportInfo.GetMinZoom(), viewportInfo.GetMaxZoom());
NS_ENSURE_TRUE_VOID(minScale.scale); // (return early rather than divide by 0)
viewport.height = std::max(viewport.height, screenH / minScale.scale);
SetCSSViewport(viewport);
float oldScreenWidth = mLastMetrics.mCompositionBounds.width;
if (!oldScreenWidth) {
oldScreenWidth = mInnerSize.width;