Closed Bug 1848528 Opened 2 years ago Closed 1 years ago

Assert that we do not create a WheelScrollAnimation if smooth scrolling is disabled

Categories

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

task

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: botond, Assigned: botond)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

While doing some code cleanup in bug 1847689, I discovered that APZ's SmoothScrollAnimation can be created in some situations when smooth scrolling is disabled.

For Bezier physics, we have a check that catches this situation and sets the animation's duration to zero; there is no corresponding check for MSD physics (an inconsistency we should address one way or another before shipping MSD physics).

Running a zero-duration animation is hacky and not ideal. For example, there is code that divides by the animation duration, and while zero-duration animations are supposed to avoid that using early exits, this is not foolproof -- for example, the early-exit is not taken if the animation is sampled with a timestamp "in the past" (so far I've only seen that happen in a buggy test (which I fixed in bug 1847689), but I'm not fully confident that it can never happen in production).

Instead, we should check whether smooth scrolling is enabled earlier in the pipeline (as we already do in some places) and if it's not then avoid creating a SmoothScrollAnimation in the first place.

The refactoring in bug 1847689 had the effect of moving the zero-duration logic into SmoothScrollAnimation's base class, GenericScrollAnimation. The other derived class, WheelScrollAnimation, does not appear to be used when smooth scrolling is disabled, and I'd like to keep it that way by adding an assert to its constructor.

We can then move towards deprecating the zero-duration codepath altogether in other follow-up bugs.

Assignee: nobody → botond
Status: NEW → ASSIGNED
Pushed by bballo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/31b1716d5e31 Assert that we don't create a WheelScrollAnimation if smooth scrolling is disabled. r=dlrobertson
Status: ASSIGNED → RESOLVED
Closed: 1 years ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: