apz side smooth scroll physics is different from main thread
Categories
(Core :: Panning and Zooming, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox82 | --- | fixed |
People
(Reporter: tnikkel, Assigned: kats)
References
Details
Attachments
(7 files)
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
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.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
I can look into this. (See also bug 1418822 comment 32)
Assignee | ||
Comment 2•4 years ago
|
||
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.
Assignee | ||
Comment 3•4 years ago
|
||
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.
Assignee | ||
Comment 4•4 years ago
|
||
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.
Assignee | ||
Comment 5•4 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&group_state=expanded&revision=f086abd6174db636d109854335c9bcbe2662075b is the new try push, I'm expecting it to be green
Assignee | ||
Comment 6•4 years ago
|
||
Assignee | ||
Comment 7•4 years ago
|
||
Assignee | ||
Comment 8•4 years ago
|
||
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
Assignee | ||
Comment 9•4 years ago
|
||
Depends on D89662
Assignee | ||
Comment 10•4 years ago
|
||
Depends on D89663
Assignee | ||
Comment 11•4 years ago
|
||
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
Assignee | ||
Comment 12•4 years ago
|
||
Depends on D89665
Assignee | ||
Comment 13•4 years ago
|
||
Depends on D89666
Assignee | ||
Comment 14•4 years ago
|
||
Rebased full stack to master: https://treeherder.mozilla.org/#/jobs?repo=try&group_state=expanded&revision=6a8832e9598421cdc3dc9ff2dc6ad7326317724c
Comment 15•4 years ago
|
||
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
Comment 16•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/574d01f80791
https://hg.mozilla.org/mozilla-central/rev/e07a8f86a5af
https://hg.mozilla.org/mozilla-central/rev/78a2b4fc4a69
https://hg.mozilla.org/mozilla-central/rev/4734b8387b50
https://hg.mozilla.org/mozilla-central/rev/05c0f3920dce
https://hg.mozilla.org/mozilla-central/rev/1c58e6aeb1e6
https://hg.mozilla.org/mozilla-central/rev/641fc4c5c561
Description
•