Closed Bug 1759958 Opened 4 years ago Closed 4 years ago

ScrollAnimationMSDPhysics::ApplyContentShift() implementation is incorrect

Categories

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

defect

Tracking

()

RESOLVED FIXED
100 Branch
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.

Blocks: 1756529

These methods seem somewhat similar but they have two important differences:

  1. Update() only changes the destination, not the current position.
  2. ApplyContentShift() does not recompute the shape of the animation curve.

The previous implementation did not actually change what PositionAt() returns.

Depends on D141318

Pushed by bballo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/43758c2e591d Add comments to clarify the purpose of ScrollAnimationPhysics::Update() and ApplyContentShift(). r=hiro https://hg.mozilla.org/integration/autoland/rev/692d1b656c58 Implement ScrollAnimationMSDPhysics::ApplyContentShift() correctly. r=hiro
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
See Also: → 1864554
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: