Skip to content

[Gecko Bug 2031862] Clear mAutoAlignStartTime when transitioning away from a finite timeline.#59928

Merged
moz-wptsync-bot merged 1 commit into
masterfrom
gecko/2031862
May 17, 2026
Merged

[Gecko Bug 2031862] Clear mAutoAlignStartTime when transitioning away from a finite timeline.#59928
moz-wptsync-bot merged 1 commit into
masterfrom
gecko/2031862

Conversation

@moz-wptsync-bot
Copy link
Copy Markdown
Collaborator

mAutoAlignStartTime is only meaningful for finite timelines: it is set in
the toFiniteTimeline branch of Animation::SetTimelineNoUpdate, and the
AutoAlignStartTime procedure asserts that the current timeline is not
monotonically increasing.

The other branch in SetTimelineNoUpdate only runs SetCurrentTimeNoUpdate
(which clears mAutoAlignStartTime as a side effect via SilentlySetCurrentTime)
when previous progress is resolved. For a pause-pending scroll-driven
animation whose start time was never auto-aligned -- mStartTime null,
mHoldTime null, so previousCurrentTime and previousProgress are both null --
that branch is skipped and the animation lands on the new (potentially
monotonic) timeline still carrying mAutoAlignStartTime = true.

Per spec [1], the fromFiniteTimeline branch only acts when previous
progress is resolved and says nothing about the unresolved case. We
deviate by unconditionally clearing mAutoAlignStartTime in that branch,
because otherwise the flag's invariant (only true while the timeline is
finite) is violated and AutoAlignStartTime would later fire on a
monotonic timeline.

Clear the flag unconditionally in the fromFiniteTimeline branch so the
invariant holds regardless of previousProgress, and keep the existing
SetCurrentTimeNoUpdate call nested inside the previous-progress check.

[1] https://drafts.csswg.org/web-animations-2/#setting-the-timeline

Differential Revision: https://phabricator.services.mozilla.com/D300738

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=2031862
gecko-commit: cf7a1644bfc0a64533b3fc427431a01d55fcc630
gecko-commit-git: a8588405288dd8fa3b173faf25cde9e1c32cfde3
gecko-reviewers: layout-scroll-driven-animation-reviewers, boris

…ine.

mAutoAlignStartTime is only meaningful for finite timelines: it is set in
the toFiniteTimeline branch of Animation::SetTimelineNoUpdate, and the
AutoAlignStartTime procedure asserts that the current timeline is not
monotonically increasing.

The other branch in SetTimelineNoUpdate only runs SetCurrentTimeNoUpdate
(which clears mAutoAlignStartTime as a side effect via SilentlySetCurrentTime)
when previous progress is resolved. For a pause-pending scroll-driven
animation whose start time was never auto-aligned -- mStartTime null,
mHoldTime null, so previousCurrentTime and previousProgress are both null --
that branch is skipped and the animation lands on the new (potentially
monotonic) timeline still carrying mAutoAlignStartTime = true.

Per spec [1], the fromFiniteTimeline branch only acts when previous
progress is resolved and says nothing about the unresolved case. We
deviate by unconditionally clearing mAutoAlignStartTime in that branch,
because otherwise the flag's invariant (only true while the timeline is
finite) is violated and AutoAlignStartTime would later fire on a
monotonic timeline.

Clear the flag unconditionally in the fromFiniteTimeline branch so the
invariant holds regardless of previousProgress, and keep the existing
SetCurrentTimeNoUpdate call nested inside the previous-progress check.

[1] https://drafts.csswg.org/web-animations-2/#setting-the-timeline

Differential Revision: https://phabricator.services.mozilla.com/D300738

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=2031862
gecko-commit: cf7a1644bfc0a64533b3fc427431a01d55fcc630
gecko-commit-git: a8588405288dd8fa3b173faf25cde9e1c32cfde3
gecko-reviewers: layout-scroll-driven-animation-reviewers, boris
Copy link
Copy Markdown
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Firefox project.

@moz-wptsync-bot moz-wptsync-bot merged commit 1b73f63 into master May 17, 2026
28 checks passed
@moz-wptsync-bot moz-wptsync-bot deleted the gecko/2031862 branch May 17, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants