Skip to content

Also update AnimationState::Paused in Animation::update_from_other if delay changes - #422

Merged
mrobinson merged 1 commit into
servo:mainfrom
mrobinson:also-update-paused-state
Jul 22, 2026
Merged

mrobinson merged 1 commit into
servo:mainfrom
mrobinson:also-update-paused-state

Conversation

@mrobinson

@mrobinson mrobinson commented Jul 9, 2026

Copy link
Copy Markdown
Member

If the delay in an animation changes, we still might need to update the
Paused state if the animation is moving from Playing to Paused.

Servo PR: servo/servo#46689

@mrobinson

Copy link
Copy Markdown
Member Author

Servo PR for this incoming.

@mrobinson

Copy link
Copy Markdown
Member Author

This is ready for review cc @yezhizhen .

servo-wpt-sync pushed a commit to servo/wpt that referenced this pull request Jul 21, 2026
…m_other` if delay changes

This incorporates servo/stylo#422 and adds a test case.

Signed-off-by: Martin Robinson <[email protected]>
Co-authored-by: Oriol Brufau <[email protected]>

@yezhizhen yezhizhen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment isn't accurate

Comment thread style/servo/animation.rs
self.started_at = old_started_at + (self.delay - old_delay);

match old_state {
Paused(old_progress) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Paused is here

Comment thread style/servo/animation.rs Outdated
},
_ => {
// Running or Pending — re-advance iterations from a fresh
// Running, Pending, or Paused — re-advance iterations from a fresh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Running, Pending, or Paused — re-advance iterations from a fresh
// Running or Pending — re-advance iterations from a fresh

This can't be paused. We are talking about old state.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hrm. Good point. The original comment neglected to include Canceled here, so I've converted this code to use an explicit match instead of a wildcard, which is slightly more self-documenting.

Comment thread style/servo/animation.rs
_ => {},
}
self.iterate_by(starting_progress);
if let AnimationState::Paused(ref mut starting_progress) = &mut self.state {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here we are talking about new state, which contain the case going from Playing to Paused.

…` if delay changes

If the delay in an animation changes, we still might need to update the
`Paused` state if the animation is moving from `Playing` to `Paused`.

Signed-off-by: Martin Robinson <[email protected]>
@mrobinson
mrobinson force-pushed the also-update-paused-state branch from 727c97b to 20e846c Compare July 22, 2026 20:21
@mrobinson

Copy link
Copy Markdown
Member Author

@yezhizhen Thanks for the review.

@mrobinson
mrobinson enabled auto-merge July 22, 2026 20:21
@mrobinson
mrobinson added this pull request to the merge queue Jul 22, 2026
Merged via the queue into servo:main with commit 6c757e5 Jul 22, 2026
5 checks passed
@mrobinson
mrobinson deleted the also-update-paused-state branch July 22, 2026 20:27
mrobinson added a commit to mrobinson/servo that referenced this pull request Jul 23, 2026
…m_other` if delay changes

This incorporates servo/stylo#422 and adds a test case.

Signed-off-by: Martin Robinson <[email protected]>
Co-authored-by: Oriol Brufau <[email protected]>
servo-wpt-sync pushed a commit to servo/wpt that referenced this pull request Jul 23, 2026
…m_other` if delay changes

This incorporates servo/stylo#422 and adds a test case.

Signed-off-by: Martin Robinson <[email protected]>
Co-authored-by: Oriol Brufau <[email protected]>
servo-wpt-sync pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 23, 2026
…m_other` if delay changes

This incorporates servo/stylo#422 and adds a test case.

Signed-off-by: Martin Robinson <[email protected]>
Co-authored-by: Oriol Brufau <[email protected]>
github-merge-queue Bot pushed a commit to servo/servo that referenced this pull request Jul 23, 2026
…m_other` if delay changes (#46689)

This incorporates servo/stylo#422 and adds a test case.

Testing: This change adds a WPT crashtest.
Fixes: #46335.

Signed-off-by: Martin Robinson <[email protected]>
Co-authored-by: Oriol Brufau <[email protected]>
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Jul 24, 2026
…ed` in `Animation::update_from_other` if delay changes, a=testonly

Automatic update from web-platform-tests
stylo: Also update `AnimationState::Paused` in `Animation::update_from_other` if delay changes

This incorporates servo/stylo#422 and adds a test case.

Signed-off-by: Martin Robinson <[email protected]>
Co-authored-by: Oriol Brufau <[email protected]>

--

wpt-commits: ace47e783b5bb7f3a16f002707de5e4c8e31a9e7
wpt-pr: 61440
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Sep 2, 2026
…ate_from_other` if delay changes. r=firefox-style-system-reviewers,emilio

This imports servo/stylo#422

If the delay in an animation changes, we still might need to update the
`Paused` state if the animation is moving from `Playing` to `Paused`.

Differential Revision: https://phabricator.services.mozilla.com/D322776
github-actions Bot pushed a commit to DioxusLabs/stylo that referenced this pull request Sep 3, 2026
…ate_from_other` if delay changes. r=firefox-style-system-reviewers,emilio

This imports servo#422

If the delay in an animation changes, we still might need to update the
`Paused` state if the animation is moving from `Playing` to `Paused`.

Differential Revision: https://phabricator.services.mozilla.com/D322776
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants