Removed exception for setting current time on a scroll linked animation #20567
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.
As far as I can tell, we are now ok to remove the exception that was
preventing current time from being set on animations using a
ScrollTimeline.
The change to hold_time_ in Animation::CommitPendingPlay is needed in
the case where the scroller has some non-zero offset and current time
has been set before play. If we set hold_time_ to 0 here, setting the
current_time on the animation has no effect, the current time from the
scroll timeline overrides it. This means that scroll-linked animations
are able to have a non-zero start_time.
I also had to add an additional condition to step 5 of the play
animation algorithm to prevent early abort when the above case occurs.
Added test for setting current time on scroll linked animation
Bug: 916117
Change-Id: I8017ce2f81496057cf5e4b8bb16b14707ee82484
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1945923
Commit-Queue: Jordan Taylor <jortaylo@microsoft.com>
Reviewed-by: Majid Valipour <majidvp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#725247}