Closed Bug 1704410 Opened 3 years ago Closed 3 years ago

Mouse wheel can initiate overscroll on macOS with apz.overscroll.enabled = true and does not snap back

Categories

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

Firefox 89
Desktop
macOS
defect

Tracking

()

VERIFIED FIXED
90 Branch
Tracking Status
firefox89 --- verified
firefox90 --- verified

People

(Reporter: sam, Assigned: botond)

References

(Blocks 1 open bug)

Details

(Whiteboard: [proton-uplift])

Attachments

(4 files)

Attached image example.png

In Nightly on macOS (tested 10.13.6 and 11.2.3) with apz.overscroll.enabled = true, the mouse wheel can also initiate overscroll without touching the trackpad. When this happens, the page gets stuck in an overscrolled state until manually scrolling down.

STR:

  1. Connect a mouse to the Mac.
  2. In about:config, set apz.overscroll.enabled = true.
  3. Visit https://github.com
  4. Using the mouse scroll wheel, scroll down, then scroll back up quickly.

Expected result:
The page does not overscroll when scrolling with the mouse wheel.

Actual result:
The page is overscrolled so there is a gap at the top of the page, even when using the mouse wheel and not the trackpad. The gap at the top of the page remains until scrolling back down manually.

Blocks: overscroll

Can't reproduce on macOS 10.14.6.

Do you have "Use smooth scrolling" enabled in about:preferences?

Flags: needinfo?(sam)

"Use smooth scrolling" is disabled on both machines exhibiting the issue. On that note, I do also have set mousewheel.acceleration.start = 1 and mousewheel.acceleration.factor = 5.

Flags: needinfo?(sam)

With smooth scrolling disabled, mousewheel scrolling takes the DispatchScroll codepath, which can cause overscrolling (without any provision to start a snap-back animation, which is the caller's responsibility to do "at the end of the gesture").

I expect this doesn't happen commonly, because if we're at the edge of the page, wheel scrolling early-exits here, but in some cases (e.g. here, "scroll down and back up quickly") we may get past that.

I think instant keyboard scrolling has a similar issue.

Summary: Mouse wheel can initiate overscroll on macOS with apz.overscroll.enabled = true → Mouse wheel can initiate overscroll on macOS with apz.overscroll.enabled = true and does not snap back
Severity: -- → S3
Priority: -- → P2
Assignee: nobody → botond

Sam, would you be able to give this build a try (it comes from this CI push), and let me know if the problem is resolved there? (Note, please check the "Use smooth scrolling" setting, and disable it if necessary, so that you're testing the same configuration in which you encountered the bug.)

Flags: needinfo?(sam)

Hi Botond, I cannot reproduce the issue in the try build with macOS 11.3 or 10.13.6. As a sanity check I performed the same profile modifications in a recent autoland build, and was able to reproduce there, so it should be an accurate result. Thanks!

Flags: needinfo?(sam)
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Thanks! That confirms my theory from comment 4. Will post the fix + a test for review shortly.

This makes the only existing place where we check
OverscrollHandoffState::mScrollSource express the check in a
more semantic way.

Also rename ScrollSource::Touch to Touchscreen for clarity.

Depends on D113457

Previously, it was implicitly disallowed by some checks in the wheel
handling code (e.g. CanScrollWithWheel()), but some cases (like
instant scroll where the starting position is away from the edge)
slipped through the cracks.

Depends on D113458

Pushed by bballo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1b6de39f20be
Introduce ScrollSourceRespectsDisregardedDirections(). r=hiro
https://hg.mozilla.org/integration/autoland/rev/9cef9dcb20b0
Split ScrollSource::Wheel into Wheel and Touchpad. r=hiro
https://hg.mozilla.org/integration/autoland/rev/891e5a5fc7bf
Explicitly disallow overscroll for wheel events. r=hiro
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch

Comment on attachment 9218547 [details]
Bug 1704410 - Explicitly disallow overscroll for wheel events. r=hiro

Beta/Release Uplift Approval Request

  • User impact if declined: [Needed for MR1 / Proton] Sometimes users are able to activate overscroll via a regular mousewheel, and the page can get stuck in the overscrolled state (no snap-back animation)
  • 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: Bug 1704659
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Targeted fix, only affects the ability of mousewheel specifically to trigger overscroll
  • String changes made/needed:
Attachment #9218547 - Flags: approval-mozilla-beta?
Attachment #9218545 - Flags: approval-mozilla-beta?
Attachment #9218546 - Flags: approval-mozilla-beta?
Whiteboard: [proton-uplift]

Comment on attachment 9218547 [details]
Bug 1704410 - Explicitly disallow overscroll for wheel events. r=hiro

Approved for 89 beta 6, thanks.

Attachment #9218547 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9218545 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9218546 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Verified fixed on Firefox beta 89.0b8 (20210504185920) and Nightly 90.0a1(20210504214950).

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

Attachment

General

Creator:
Created:
Updated:
Size: