Repository navigation
Optimize Animation::iterate() into Animation::iterate_by() - #400
Merged
Merged
Conversation
Loirooriol
commented
Jun 25, 2026
Loirooriol
force-pushed
the
optimize-animation-iterate
branch
from
June 25, 2026 15:05
8818ed9 to
8e49442
Compare
This method was performing a single iteration. But most callers want to perform multiple iterations, so they were calling it in a loop. So this patch replaces `iterate()` with `iterate_by()`, which takes the desired number of iterations as a parameter, and returns the actual number of iterations that were performed. Signed-off-by: Oriol Brufau <[email protected]>
Loirooriol
force-pushed
the
optimize-animation-iterate
branch
from
June 25, 2026 19:07
8e49442 to
323937f
Compare
Loirooriol
added a commit
to Loirooriol/servo
that referenced
this pull request
Jun 25, 2026
Bump Stylo to servo/stylo#400 Signed-off-by: Oriol Brufau <[email protected]>
Loirooriol
marked this pull request as ready for review
June 25, 2026 20:09
yezhizhen
reviewed
Jun 26, 2026
| self.iterate(); | ||
| progress -= 1.; | ||
| } | ||
| progress -= self.iterate_by(progress); |
Member
There was a problem hiding this comment.
The progress we pass to iterate_by can actually be negative.
The behaviour actually does not change. But was there always a bug here?
Collaborator
Author
There was a problem hiding this comment.
Not sure I'm following, what do you think should happen if progress is negative?
Member
There was a problem hiding this comment.
Nvm. I think it is correct. We will set the self.state = Paused(progress); one line below.
mrobinson
approved these changes
Jun 26, 2026
Loirooriol
added a commit
to Loirooriol/servo
that referenced
this pull request
Jun 26, 2026
Bump Stylo to servo/stylo#400 Signed-off-by: Oriol Brufau <[email protected]>
Loirooriol
added a commit
to Loirooriol/servo
that referenced
this pull request
Jun 26, 2026
…servo#45978) Bump Stylo to servo/stylo#400 Testing: Not needed, no change in behavior Signed-off-by: Oriol Brufau <[email protected]>
Loirooriol
added a commit
to Loirooriol/servo
that referenced
this pull request
Jun 26, 2026
…servo#45978) Bump Stylo to servo/stylo#400 Testing: Not needed, no change in behavior Signed-off-by: Oriol Brufau <[email protected]>
Loirooriol
added a commit
to Loirooriol/servo
that referenced
this pull request
Jun 26, 2026
…servo#45978) Bump Stylo to servo/stylo#400 Testing: Not needed, no change in behavior Signed-off-by: Oriol Brufau <[email protected]>
servo-wpt-sync
pushed a commit
to servo/wpt
that referenced
this pull request
Jun 26, 2026
…web-platform-tests#45978) Bump Stylo to servo/stylo#400 Testing: Not needed, no change in behavior Signed-off-by: Oriol Brufau <[email protected]>
Loirooriol
added a commit
that referenced
this pull request
Jul 1, 2026
This method was performing a single iteration. But most callers want to perform multiple iterations, so they were calling it in a loop. So this patch replaces `iterate()` with `iterate_by()`, which takes the desired number of iterations as a parameter, and returns the actual number of iterations that were performed. Servo PR: servo/servo#45978 Signed-off-by: Oriol Brufau <[email protected]>
lando-worker Bot
pushed a commit
to mozilla-firefox/firefox
that referenced
this pull request
Jul 7, 2026
…e_by()`. r=firefox-style-system-reviewers,emilio This method was performing a single iteration. But most callers want to perform multiple iterations, so they were calling it in a loop. So this patch replaces `iterate()` with `iterate_by()`, which takes the desired number of iterations as a parameter, and returns the actual number of iterations that were performed. Imports servo/stylo#400 Differential Revision: https://phabricator.services.mozilla.com/D310919
github-actions Bot
pushed a commit
to longvatrong111/stylo
that referenced
this pull request
Jul 8, 2026
…e_by()`. r=firefox-style-system-reviewers,emilio This method was performing a single iteration. But most callers want to perform multiple iterations, so they were calling it in a loop. So this patch replaces `iterate()` with `iterate_by()`, which takes the desired number of iterations as a parameter, and returns the actual number of iterations that were performed. Imports servo#400 Differential Revision: https://phabricator.services.mozilla.com/D310919
zerox80
pushed a commit
to zerox80/firefox
that referenced
this pull request
Oct 16, 2026
…e_by()`. r=firefox-style-system-reviewers,emilio This method was performing a single iteration. But most callers want to perform multiple iterations, so they were calling it in a loop. So this patch replaces `iterate()` with `iterate_by()`, which takes the desired number of iterations as a parameter, and returns the actual number of iterations that were performed. Imports servo/stylo#400 Differential Revision: https://phabricator.services.mozilla.com/D310919
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.
This method was performing a single iteration. But most callers want to perform multiple iterations, so they were calling it in a loop.
So this patch replaces
iterate()withiterate_by(), which takes the desired number of iterations as a parameter, and returns the actual number of iterations that were performed.Servo PR: servo/servo#45978