Closed Bug 1701077 Opened 3 years ago Closed 3 years ago

The overscroll animation's starting velocity can be diagonal when only one axis allows overscrolling

Categories

(Core :: Panning and Zooming, defect)

defect

Tracking

()

VERIFIED FIXED
89 Branch
Tracking Status
firefox89 --- verified

People

(Reporter: mstange, Assigned: hiro)

References

Details

Attachments

(3 files)

Steps to reproduce:

  1. Be on macOS and have apz.overscroll.enabled set to true.
  2. Be on a page that's only scrollable vertically.
  3. Option A: Scroll up into overscroll and then fling to the side.
  4. Option B: With a bit of distance from the top, do a slightly diagonal fling towards the top left.

Expected results:
Since we currently don't allow horizontal overscroll unless the page is scrollable horizontally (bug 1686151), the overscroll animation should only go upwards, not to the side.

Actual results:
The overscroll animation shifts the page horizontally and not just vertically.

This only happens for flings, i.e. if the overscroll is started with some velocity. I think we're respecting the horizontal component of the scrolling velocity vector when we should be ignoring it.
I'm hitting this all the time, for example I've hit it again in this textbox while typing this bug report. Most of my vertical flings have an unintended diagonal component to them.

Something similar happens on both-axes-scrollable pages for slightly diagonal flings which are axis-locked to vertical flings. We scroll only vertically due to the axis lock, but then once we hit the top edge we forget about the axis lock and start a diagonal overscroll. (Edit: I filed bug 1701699 about this problem.)

Looks like we should just call AdjustDeltaForAllowedScrollDirections for the velocity in StartOverscrollAnimation.

I tried it with GetCurrentPanGestureBlock()->GetAllowedScrollDirections() but it didn't work as expected since the GetAllowedScrollDirections() returns the result of AsyncPanZoomController::GetAllowedHandoffDirections.

Assignee: nobody → hikezoe.birchill
Status: NEW → ASSIGNED
Attachment #9211669 - Attachment description: Bug 1701077 - Drop the overscroll animation's velocity on axises where we don't allow overscrolling. r?botond → Bug 1701077 - Drop the overscroll animation's velocity on axes where we don't allow overscrolling. r?botond
Pushed by hikezoe.birchill@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/77d0d14fe116
Factor out GetOverscrollableDirections. r=botond
https://hg.mozilla.org/integration/autoland/rev/bfdd43326ef9
Drop the overscroll animation's velocity on axes where we don't allow overscrolling. r=botond
https://hg.mozilla.org/integration/autoland/rev/16bc0a4dbf29
Use ScrollDirections for OverscrollEffectBase::ConsumeOverscroll. r=botond
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch

Verified fixed in beta 89.0b2 (20210420191345) and Nightly 90.0a1 (2021-04-20) (20210420213949) on MacOS 11.2.3.

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

Attachment

General

Created:
Updated:
Size: