Assert that we do not create a WheelScrollAnimation if smooth scrolling is disabled
Categories
(Core :: Panning and Zooming, task, P3)
Tracking
()
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 | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
Comment 3•1 years ago
|
||
bugherder |
Description
•