Closed Bug 1805601 Opened 1 year ago Closed 1 year ago

https://wpt.fyi/ is broken after pinch zooming then resetting

Categories

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

Firefox 110
x86_64
Linux
defect

Tracking

()

VERIFIED FIXED
110 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox108 --- unaffected
firefox109 + verified
firefox110 + verified

People

(Reporter: gregp, Assigned: botond)

References

(Regression, )

Details

(Keywords: regression)

Attachments

(2 files)

Attached video page_cut_in_half.webm

Steps to reproduce:

  1. Navigate to https://wpt.fyi/
  2. Pinch zoom at the top right corner
  3. Reset pinch zoom with Ctrl+0 keyboard shortcut

Actual results:
Page is cut in half

Expected results:
Page is normal and centered

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

:TYLin, since you are the author of the regressor, bug 1803863, could you take a look? Also, could you set the severity field?

For more information, please visit auto_nag documentation.

Flags: needinfo?(aethanyc)
Keywords: regression

Whoops, found a better range

Flags: needinfo?(aethanyc)
Regressed by: 1519339
No longer regressed by: 1803863

:botond, since you are the author of the regressor, bug 1519339, could you take a look? Also, could you set the severity field?

For more information, please visit auto_nag documentation.

Component: Layout: Tables → Panning and Zooming
Flags: needinfo?(botond)

Confirmed. Seems to happen to other sites too.

Assignee: nobody → botond
Severity: -- → S2
Flags: needinfo?(botond)
Priority: -- → P2

Interestingly I can't reproduce either on Windows 11 or on Linux, but I can see the issue on Mac.

The specific regressing patch is https://phabricator.services.mozilla.com/D163532.

(In reply to Botond Ballo [:botond] from comment #6)

The specific regressing patch is https://phabricator.services.mozilla.com/D163532.

This patch fixes a bug where, after zooming out, which shrinks the visual scroll range, the visual viewport offset is not re-clamped to the new scroll range on the main thread, resulting in the main thread's copy of the visual viewport offset temporarily being out of bounds.

That bug only affects cases where the zooming out is done by calling SetResolutionAndScaleTo() directly, rather than through APZ pinch-zoom or double-tap zoom. The test in bug 1519339 does this, and indeed I thought only tests could do this, though I now realize that the implementation of Ctrl+0 does this as well.

The reason this fix caused a regression is that it exposed another latent bug where, in the affected scenario, APZ didn't re-clamp the visual viewport offset either.

The two bugs effectively cancelled each other out by interacting in a weird way (basically, the first bug led to the main thread having an invalid visual viewport offset, which then caused the main-thread logic for trying to preserve the relative scroll offset to scroll to another invalid offset, which triggered a scroll offset update to APZ, which caused APZ to take a codepath where it does re-clamp the visual viewport offset). Fixing the first bug exposed the second and therefore regressed Ctrl+0 behaviour.

We already had logic for reclamping the visual viewport offset if the
composition bounds changes, but since the composition bounds is in
ParentLayer (post-zoom) coordinates, this didn't handle the case where
the zoom changes.

Pushed by bballo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e5d669d49e62
Reclamp the visual viewport offset in APZ if the zoom changes. r=tnikkel
Duplicate of this bug: 1706852
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch

The patch landed in nightly and beta is affected.
:botond, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox109 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(botond)

Yes, this is something we'd like to uplift.

Flags: needinfo?(botond)

Comment on attachment 9308881 [details]
Bug 1805601 - Reclamp the visual viewport offset in APZ if the zoom changes. r=tnikkel,dlrobertson

Beta/Release Uplift Approval Request

  • User impact if declined: After pinch-zooming in, resetting the zoom level via Ctrl+0 (or View --> Zoom --> Actual Size) may temporarily result in the page being rendered at an out-of-bounds scroll offset, until the page is scrolled or something else triggers a repaint
  • 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): It's a simple change to clamp an out-of-bounds scroll offset to its valid range, unlikely to have unexpected effects
  • String changes made/needed:
  • Is Android affected?: No
Attachment #9308881 - Flags: approval-mozilla-beta?

Comment on attachment 9308881 [details]
Bug 1805601 - Reclamp the visual viewport offset in APZ if the zoom changes. r=tnikkel,dlrobertson

Approved for Desktop 109.0b6 and Mobile 109.0b3.

Attachment #9308881 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]
Flags: qe-verify+

I tried to reproduce this on my MacBook with macOS 13.1 using an old Nightly from 2022-12-13 but I was unable to. Also due to holidays we are in lack of a Laptop or a touchscreen with Linux, Windows so we are unable to verify this issue.

Gregory Pappas [:gregp] would you mind verifying that this is fixed for you in the latest builds of Nightly and Beta (109.0b6)? You can download them using the following links:
Beta - https://archive.mozilla.org/pub/firefox/candidates/109.0b6-candidates/build1/linux-x86_64/en-US/firefox-109.0b6.tar.bz2
Nightly - https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-110.0a1.en-US.linux-x86_64.tar.bz2

Flags: needinfo?(gp3033)

(In reply to Bogdan Maris [:bogdan_maris], Release Desktop QA from comment #17)

Gregory Pappas [:gregp] would you mind verifying that this is fixed for you in the latest builds of Nightly and Beta (109.0b6)? You can download them using the following links

I can verify that the bug is fixed in Firefox Nightly 20221220093956 and Firefox Beta 109.0b6.

Flags: needinfo?(gp3033)

Thanks for verifying! Closing as verified based on the above.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Duplicate of this bug: 781021
No longer duplicate of this bug: 781021
See Also: → 1818967
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: