Closed Bug 1638773 Opened 2 months ago Closed 2 months ago

device-width conflict values in between initial-scale and width

Categories

(Core :: Panning and Zooming, defect, P1)

78 Branch
Unspecified
Android
defect

Tracking

()

VERIFIED FIXED
mozilla78
Webcompat Priority ?
Tracking Status
firefox-esr68 --- unaffected
firefox76 --- unaffected
firefox77 + verified
firefox78 + fixed

People

(Reporter: karlcow, Assigned: bradwerth)

References

(Regression, )

Details

(Keywords: regression)

Attachments

(1 file)

There is a site with these values

<meta name="viewport"
      content="initial-scale=device-width, 
               maximum-scale=1.0, 
               user-scalable=no, 
               width=device-width">

The site is hugely blown out.

The current specification says:
https://drafts.csswg.org/css-device-adapt/#min-scale-max-scale

device-width and device-height are translated to 10

so we end up with

<meta name="viewport"
      content="initial-scale=10, 
               maximum-scale=1.0, 
               user-scalable=no, 
               width=device-width">

which should win?

  • Chrome shows the site with width=device-width
  • Firefox shows the site x10 zoom

This is yet another edge case.

note: can be reproduced on rdm.

see details on https://webcompat.com/issues/52856

I'd say the scale value should be 1.0.
Does the site work fine before bug 1598145?

Regressed by: 1598145

Set release status flags based on info from the regressing bug 1598145

Flags: needinfo?(bwerth)
Assignee: nobody → bwerth
Flags: needinfo?(bwerth)
Component: DOM: Core & HTML → Panning and Zooming

This is solvable by adding a clamp to the code introduced in Bug 1598145. I'll propose a patch with a fix and a web platform test.

This corrects the handling of user-scalable=no to first apply the clamping
of the initial-scale (whether specified or default) to the min and max scales.

Severity: -- → S2
Priority: -- → P3
Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0143fd91ba20
Allow initial-scale clamping when user-scalable=no, add WPT. r=hiro
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/23713 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
Upstream PR merged by moz-wptsync-bot

Thanks to :hiro for bringing this to the attention of the Fenix team. Could we please request this be uplifted to 77 so that we can get this fix for the Fenix product market fit experiment?

Flags: needinfo?(hikezoe.birchill)

Comment on attachment 9150299 [details]
Bug 1638773: Allow initial-scale clamping when user-scalable=no, add WPT.

Beta/Release Uplift Approval Request

  • User impact if declined: Sites with meta viewport tags with user-scalable=no and very large or very small initial-scale will appear at unreadable sizes in GeckoView.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The code change only applies when user-scalable=no, which is an uncommon pattern and noted as bad practice (though permitted by spec).
  • String changes made/needed:
Attachment #9150299 - Flags: approval-mozilla-beta?
Flags: needinfo?(hikezoe.birchill)

Comment on attachment 9150299 [details]
Bug 1638773: Allow initial-scale clamping when user-scalable=no, add WPT.

Fixes an important mobile web compat issue affecting Fenix. Approved for 77.0b9.

Attachment #9150299 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: in-testsuite+

Changing the priority to p1 as the bug is tracked by a release manager for the current beta.
See What Do You Triage for more information

Priority: P3 → P1
Blocks: 1639964

Thank you Brad and Emily!

Verified as fixed on the reported website, on Fenix Beta 5.1-beta2.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.