Closed Bug 1658169 Opened 4 years ago Closed 4 years ago

apz side smooth scroll physics is different from main thread

Categories

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

defect

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: tnikkel, Assigned: kats)

References

Details

Attachments

(7 files)

On the apz side we have only one type of smooth scroll physics, it uses a mass spring damping system (MSD).

On the main thread we have two types of smooth scroll physics: the same MSD one as on the apz side, and another traditional one.

Animations for page scrolls that come from scrollbars (clicking in the scrollbar track but not on the scroll thumb) used the tradtional physics on the main thread. But with pinch zooming scrollbars need to scroll the visual viewport which only apz can do, which means these scrolls much use the MSD physics.

Markus has said that MSD physics are good for scroll snap type situations, but less ideal for user interactions like page scroll etc. So this bug is to track if we need to implement the traditional physics on the apz side.

Severity: -- → S3
Priority: -- → P3

I can look into this. (See also bug 1418822 comment 32)

Assignee: nobody → kats

https://searchfox.org/mozilla-central/rev/fa7f47027917a186fb2052dee104cd06c21dd76f/gfx/layers/apz/src/KeyboardScrollAnimation.cpp#28-33 - The pageup/pagedown APZ keyboard scroll animation uses the MSD implementation, but with prefs that make the behaviour similar to the main-thread implementation. We should be able to do something similar for the scrollbar stuff. It's slightly more complicated since we just get a pure relative scroll delta instead having a dedicated input type, but we should be able to make it work.

This should be easier to do after the patches in bug 1662013 as we should be able to distinguish between "smooth" and "smoothMsd" requests on the APZ side and start a scroll animation with appropriate physics.

Depends on: 1662013

This turned out to be pretty straightforward conceptually, although involved a lot of moving code around to make sure things were consistently named.

https://treeherder.mozilla.org/#/jobs?repo=try&group_state=expanded&revision=b6ba12d265eabdd3e1f920f9732901150bf9c517 has the patches, on top of my stack from bug 1662013 and friends.

This is used for scrolls of type eSmoothMsd that the main-thread sends over,
and for scroll snapping. For consistent naming let's call this smooth msd.

Depends on D89661

This is just moving code to make it reusable in APZ. As part of this, I replace
use of Preferences::* with the StaticPrefs::* API, because we can't use
Preferences:: in the GPU process and we'll want to be able to invoke this code
from there.

Depends on D89664

Pushed by kgupta@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/574d01f80791
Unified compilation fixes. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/e07a8f86a5af
Rename the existing smooth scroll on the APZ side to smooth-msd. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/78a2b4fc4a69
Move the SmoothMsdScrollAnimation into its own file. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/4734b8387b50
Moving missing general.smoothScroll* prefs from all.js to StaticPrefs.yaml. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/05c0f3920dce
Move the origin-based physics computation to APZPublicUtils. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/1c58e6aeb1e6
Add a SmoothScrollAnimation that matches the main-thread smooth scroll physics. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/641fc4c5c561
Have smooth-type scroll updates trigger smooth scroll animations. r=tnikkel
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: