Bug 1536755 Part 1: Enforce viewport zoom constraints when the content size changes. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D24424

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brad Werth 2019-03-22 21:01:26 +00:00
parent 01e23b1896
commit 5a6a418623

View File

@ -401,8 +401,17 @@ void MobileViewportManager::UpdateResolution(
// Even in other scenarios, we want to ensure that zoom level is
// not _smaller_ than the intrinsic scale, otherwise we might be
// trying to show regions where there is no content to show.
if (zoom < intrinsicScale) {
newZoom = Some(intrinsicScale);
CSSToScreenScale clampedZoom = zoom;
if (clampedZoom < intrinsicScale) {
clampedZoom = intrinsicScale;
}
// Also clamp to the restrictions imposed by aViewportInfo.
clampedZoom = ClampZoom(clampedZoom, aViewportInfo);
if (clampedZoom != zoom) {
newZoom = Some(clampedZoom);
}
}
}