Repository navigation
Always use progress=1.0 for 0 duration animation values - #403
Merged
mrobinson merged 1 commit intoJun 27, 2026
Merged
Conversation
nicoburns
approved these changes
Jun 26, 2026
Loirooriol
approved these changes
Jun 26, 2026
| let progress = if self.property_animation.duration == 0.0 { | ||
| 1.0 | ||
| } else { | ||
| (time - self.start_time) / (self.property_animation.duration) |
Collaborator
There was a problem hiding this comment.
While at it, unnecessary parentheses:
Suggested change
| (time - self.start_time) / (self.property_animation.duration) | |
| (time - self.start_time) / self.property_animation.duration |
mrobinson
force-pushed
the
one-progress-for-zero-duration-animations
branch
2 times, most recently
from
June 26, 2026 19:00
9a38345 to
07895b9
Compare
mrobinson
marked this pull request as ready for review
June 26, 2026 19:04
Transitions can sometimes have 0 duration when the transition reversing shortening factor is also calculated to be 0. When that happens, we should always use 1.0 for the progress when calculating the value for the transition. This avoid division by zero. Signed-off-by: Martin Robinson <[email protected]>
mrobinson
force-pushed
the
one-progress-for-zero-duration-animations
branch
from
June 27, 2026 09:30
07895b9 to
7ecccbf
Compare
pull Bot
pushed a commit
to Haofei/servo
that referenced
this pull request
Jun 27, 2026
…#46016) This commits makes two changes to prevent animations from producing invalid color values (defense in depth): 1. Update Stylo to a version that fixing an issue with interpolation of values in interrupted transitions that are reversing[^1]. 2. Prevents the creation of WebRender color values with alpha that is out of range. [^1]: https://www.w3.org/TR/css-transitions-1/#reversing Stylo PR: servo/stylo#403 Testing: This change adds a WPT crash test. Fixes: servo#45945
Loirooriol
pushed a commit
that referenced
this pull request
Jul 1, 2026
Transitions can sometimes have 0 duration when the transition reversing shortening factor is also calculated to be 0. When that happens, we should always use 1.0 for the progress when calculating the value for the transition. This avoid division by zero. Servo PR: servo/servo#46016 Signed-off-by: Martin Robinson <[email protected]>
lando-worker Bot
pushed a commit
to mozilla-firefox/firefox
that referenced
this pull request
Jul 7, 2026
…. r=firefox-style-system-reviewers,emilio Transitions can sometimes have 0 duration when the transition reversing shortening factor is also calculated to be 0. When that happens, we should always use 1.0 for the progress when calculating the value for the transition. This avoid division by zero. Imports servo/stylo#403 Differential Revision: https://phabricator.services.mozilla.com/D310924
github-actions Bot
pushed a commit
to longvatrong111/stylo
that referenced
this pull request
Jul 8, 2026
…. r=firefox-style-system-reviewers,emilio Transitions can sometimes have 0 duration when the transition reversing shortening factor is also calculated to be 0. When that happens, we should always use 1.0 for the progress when calculating the value for the transition. This avoid division by zero. Imports servo#403 Differential Revision: https://phabricator.services.mozilla.com/D310924
zerox80
pushed a commit
to zerox80/firefox
that referenced
this pull request
Oct 16, 2026
…. r=firefox-style-system-reviewers,emilio Transitions can sometimes have 0 duration when the transition reversing shortening factor is also calculated to be 0. When that happens, we should always use 1.0 for the progress when calculating the value for the transition. This avoid division by zero. Imports servo/stylo#403 Differential Revision: https://phabricator.services.mozilla.com/D310924
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Transitions can sometimes have 0 duration when the transition reversing
shortening factor is also calculated to be 0. When that happens, we
should always use 1.0 for the progress when calculating the value for
the transition. This avoid division by zero.
Servo PR: servo/servo#46016