ScrollAnimationMSDPhysics::ApplyContentShift() implementation is incorrect
Categories
(Core :: Panning and Zooming, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox100 | --- | fixed |
People
(Reporter: botond, Assigned: botond)
References
Details
Attachments
(2 files)
GenericScrollAnimation overrides HandleScrollOffsetUpdate() to handle relative scroll offset updates without interrupting the animation.
The implementation calls ScrollAnimationPhysics::ApplyContentShift(). This is intended to shift both the current position and the destination of the animation by the provided argument.
ScrollAnimationPhysics has two implementations, ScrollAnimationBezierPhysics and ScrollAnimationMSDPhysics.
The Bezier implementation of ApplyContentShift() is correct: it adjusts mStartPos and mDestination, and then PositionAt() interpolates between those two values.
The MSD implementation, however, is incorrect. It too adjusts mStartPos and mDestination, but these adjustments have no impact on the result of PositionAt(), which is instead based on state inside the AxisPhysicsMSDModels.
| Assignee | ||
Comment 1•4 years ago
|
||
These methods seem somewhat similar but they have two important differences:
- Update() only changes the destination, not the current position.
- ApplyContentShift() does not recompute the shape of the animation curve.
| Assignee | ||
Comment 2•4 years ago
|
||
The previous implementation did not actually change what PositionAt() returns.
Depends on D141318
Comment 4•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/43758c2e591d
https://hg.mozilla.org/mozilla-central/rev/692d1b656c58
Description
•