Closed Bug 1335958 Opened 4 years ago Closed 4 years ago

Simplify APZ overscroll physics


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




Tracking Status
firefox54 --- fixed
firefox89 --- verified
firefox90 --- verified


(Reporter: botond, Assigned: botond)


(Blocks 1 open bug)



(1 file)

APZ currently supports an oscillation spring-based overscroll effect.

This was used by B2G, and now that we no longer support B2G, we don't need it anymore.

However, we will want an overscroll effect for macOS (tracked by bug 1124108). So rather than removing APZ's overscroll animation, I propose that we just modify its physics to be what we want for macOS.

Markus' WIP patch in bug 1124108 already does this, but I'd like to land the parts that concern the overscroll physics now, because it will make the refactoring we're planning to do in bug 1282245 easier. I will do so in this bug.
Assignee: nobody → botond
One thing this patch does not do is add prefs for the various constants used by the new physics. I'll leave it to Markus to decide which constants it makes sense to add prefs for, in bug 1124108.
Comment on attachment 8832701 [details]
Bug 1335958 - Simplify APZ overscroll physics.

Looks fairly straightforward. Nice to see lots of code deletion :)

::: gfx/layers/apz/src/Axis.h:285
(Diff revision 1)
> +  // The mass-spring-damper model for overscroll physics.
> +  AxisPhysicsMSDModel mMSDModel;
> +

nit: move this up so it's next to mOverscroll (i.e. group overscroll-related fields together)

::: gfx/layers/apz/src/Axis.cpp:259
(Diff revision 1)
> -             mLastOverscrollPeak == 0 &&
> -             mOverscrollScale == 1);
> -
>    SetVelocity(aVelocity);
> +  mMSDModel.SetPosition(mOverscroll);
> +  mMSDModel.SetVelocity(mVelocity * 1000.0);

Presumably this 1000 is a units conversion, can you add a comment that specifies what units we're converting from/to?
Attachment #8832701 - Flags: review?(bugmail) → review+
Addressed review comments.
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54

Verified as fixed, since the overscroll physics have been applied, in beta 89.0b2 (20210420191345) and Nightly 90.0a1 (2021-04-20) (20210420213949) on MacOS 11.2.3. The prefs functionality is still debatable.

You need to log in before you can comment on or make changes to this bug.