Closed Bug 1894122 Opened 2 years ago Closed 1 year ago

"Dead zone" during scrolling when panning back and forth in a single gesture (sticky axis locking eats vertical movement in some cases)

Categories

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

defect

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: mstange, Assigned: dlrobertson)

References

(Blocks 3 open bugs)

Details

Attachments

(3 files)

Attached video Screen recording

Steps to reproduce:

  1. Go to a page that's scrollable both vertically and horizontally, for example https://loglog.games/blog/leaving-rust-gamedev/ .
  2. Scroll down into the middle of the page.
  3. Do an "up 40%, down 80%" scroll gesture: With your finger starting in the middle of the screen, scroll up, and, without lifting your finger, scroll back down, and past where your finger started.
  4. Optionally, with your finger still on the screen, keep scrolling back and forth.

Expected results:
Scrolling should behave normally.

Actual results:
Whenever your finger goes past the position where it started, there is a "hitch" in the scrolling - some of the vertical delta of your pan movement is absorbed and doesn't result in the page moving vertically.
The further your finger has drifted horizontally away from the X position where the finger started, the longer the "hitch" - the bigger the "dead zone".

What happens here is that sticky axis locking remembers where the pan gesture started. Whenever the vector between the touch down position and the current position has a bigger horizontal component than vertical component, no vertical scrolling happens. This creates triangular zones emanating from the touch start position where vertical scrolling is blocked.

Summary: Triangular "dead zone" when scrolling back and forth in a single pan gesture (sticky axis locking eats vertical movement in some cases) → "Dead zone" during scrolling when panning back and forth in a single gesture (sticky axis locking eats vertical movement in some cases)
Blocks: perf-android
Blocks: 1895538

The severity field is not set for this bug.
:botond, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(botond)

This is one of the bugs we're tracking in FFXP-2856.

Severity: -- → S3
Flags: needinfo?(botond)
Priority: -- → P3

The code in question is here in AsyncPanZoomController::HandlePanningUpdate;

ParentLayerPoint vector =
    ToParentLayerCoordinates(aPanDistance, mStartTouch);

float angle = atan2f(vector.y, vector.x);  // range [-pi, pi]
angle = fabsf(angle);                      // range [0, pi]

Assignee: nobody → drobertson

For long touch scrolls that change direction, using the start point of
the touch scroll as the origin to calculate the angle of the scroll is
problematic for determine the axis that should be locked. Maintain a
list of recent touch gesture points and calculate the gesture angle from
the most recent touch gesture points.

Add a minimum size parameter to the RecentEventsBuffer, for the scenario
in which we would prefer data from stale events to that of the fallback.

Blocks: 1915260

I've tested a local GVE build with this patch applied and can confirm that it solves the problem! It feels much much better than before. Thank you!

Pushed by drobertson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1355b1b3841c Add a minimum size parameter to the RecentEventsBuffer. r=botond https://hg.mozilla.org/integration/autoland/rev/a1bbca68e1f7 Improve axis locking for touch scrolls. r=botond

Found a way to reproduce this try failure locally over the weekend.

Flags: needinfo?(drobertson)

I see these patches were pushed to Try recently and I'm not seeing any failures that look related -- is this ready to land?

Flags: needinfo?(drobertson)

Ah rats! I forgot to make the tests only run on android

Flags: needinfo?(drobertson)

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

I see these patches were pushed to Try recently and I'm not seeing any failures that look related -- is this ready to land?

My bad, I did overlook that the desktop gtest failure is a failing APZ test and so likely caused by the patch.

(In reply to Dan Robertson (:dlrobertson) from comment #11)

Ah rats! I forgot to make the tests only run on android

It looks like the failing test is actually a desktop test that was somehow regressed.

Pushed by drobertson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d8d077687277 Add a minimum size parameter to the RecentEventsBuffer. r=botond https://hg.mozilla.org/integration/autoland/rev/374bd6b07bbf Improve axis locking for touch scrolls. r=botond
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: