Bug 1501665 - No bug: Add comment with rationale behind choice of default viewport. r=dbaron

Especially in view of the patches for bug 1501665, which seem to have some-
what misunderstood the reason for the choice of viewport width here.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jan Henning 2019-03-05 18:01:07 +00:00
Родитель 92ae1aa498
Коммит 6080b6fb5c
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -6792,8 +6792,16 @@ nsViewportInfo Document::GetViewportInfo(const ScreenIntSize& aDisplaySize) {
// https://drafts.csswg.org/css-device-adapt/#resolve-width
if (width == nsViewportInfo::Auto) {
if (height == nsViewportInfo::Auto || aDisplaySize.height == 0) {
// Stretch CSS pixel size of viewport to keep device pixel size
// unchanged after full zoom applied.
// If we don't have any applicable viewport width constraints, this is
// most likely a desktop page written without mobile devices in mind.
// We use the desktop mode viewport for those pages by default,
// because a narrow viewport based on typical mobile device screen
// sizes (especially in portrait mode) will frequently break the
// layout of such pages. To keep text readable in that case, we rely
// on font inflation instead.
// Divide by fullZoom to stretch CSS pixel size of viewport in order
// to keep device pixel size unchanged after full zoom applied.
// See bug 974242.
width = gfxPrefs::DesktopViewportWidth() / fullZoom;
} else {