Commit 31ebf588 authored by Kevin Ellis's avatar Kevin Ellis Committed by Commit Bot

Remove PlayStateUpdateScope from Animation::currentTime

Calculating the current time does not alter any variables
that could affect the play state, The check may have been required
previously when the finished state of an animation was only being
updated in UpdateCurrentTimingState.

This patch also removes a superfluous check from currentTime. It
is not possible to be in an idle state while having start time.

Bug: 960944
Change-Id: I5e17c6a9b73400eb5358ae762f8d61d431818a50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1914828
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Reviewed-by: default avatarMajid Valipour <majidvp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715350}
parent 43d4baee
...@@ -408,8 +408,6 @@ double Animation::currentTime(bool& is_null) { ...@@ -408,8 +408,6 @@ double Animation::currentTime(bool& is_null) {
// https://drafts.csswg.org/web-animations/#the-current-time-of-an-animation // https://drafts.csswg.org/web-animations/#the-current-time-of-an-animation
double Animation::currentTime() { double Animation::currentTime() {
PlayStateUpdateScope update_scope(*this, kTimingUpdateOnDemand);
// 1. If the animation’s hold time is resolved, // 1. If the animation’s hold time is resolved,
// The current time is the animation’s hold time. // The current time is the animation’s hold time.
if (hold_time_.has_value()) if (hold_time_.has_value())
...@@ -420,8 +418,7 @@ double Animation::currentTime() { ...@@ -420,8 +418,7 @@ double Animation::currentTime() {
// * the associated timeline is inactive, or // * the associated timeline is inactive, or
// * the animation’s start time is unresolved. // * the animation’s start time is unresolved.
// The current time is an unresolved time value. // The current time is an unresolved time value.
if (!timeline_ || !timeline_->IsActive() || PlayStateInternal() == kIdle || if (!timeline_ || !timeline_->IsActive() || !start_time_) {
!start_time_) {
return NullValue(); return NullValue();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment