Commit 49d4b7c4 authored by Kevin Ellis's avatar Kevin Ellis Committed by Commit Bot

Remove PlayStateInternal from Animation::UnlimitedCurrentTimeInternal

PlayStateInternal is being phased out as it relies on an extended play
state that includes a non-spec-compliant pending state. This patch
cleans up the implementation of UnlimitedCurrentTimeInternal. The
DCHECK code was previously used as a sanity check to ensure that an
update to the timing calculations did not change the value of current
time. This check is no longer being performed. The unlimited time
may deviate from the current time for a finished animations since the
hold time is not being used in the calculation when a start time is
set and not paused.

Bug: 960944
Change-Id: Ie8bd77b8cf770dc79fa65a08ed66c88fd6327c81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933123
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Reviewed-by: default avatarMajid Valipour <majidvp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719210}
parent 667f448f
......@@ -432,11 +432,8 @@ base::Optional<double> Animation::CurrentTimeInternal() const {
return hold_time_ ? hold_time_ : CalculateCurrentTime();
}
base::Optional<double> Animation::UnlimitedCurrentTimeInternal() const {
#if DCHECK_IS_ON()
CurrentTimeInternal();
#endif
return PlayStateInternal() == kPaused || !start_time_
base::Optional<double> Animation::UnlimitedCurrentTime() const {
return CalculateAnimationPlayState() == kPaused || !start_time_
? CurrentTimeInternal()
: CalculateCurrentTime();
}
......
......@@ -126,7 +126,7 @@ class CORE_EXPORT Animation : public EventTargetWithInlineData,
void setCurrentTime(double new_current_time,
bool is_null,
ExceptionState& = ASSERT_NO_EXCEPTION);
base::Optional<double> UnlimitedCurrentTimeInternal() const;
base::Optional<double> UnlimitedCurrentTime() const;
// https://drafts.csswg.org/web-animations/#play-states
static const char* PlayStateString(AnimationPlayState);
......
......@@ -406,7 +406,7 @@ void CSSAnimations::CalculateAnimationUpdate(CSSAnimationUpdate& update,
CreateKeyframeEffectModel(resolver, animating_element,
element, &style, parent_style, name,
keyframe_timing_function.get(), i),
timing, is_paused, animation->UnlimitedCurrentTimeInternal()),
timing, is_paused, animation->UnlimitedCurrentTime()),
specified_timing, keyframes_rule,
animation_data->PlayStateList());
if (is_paused != was_paused)
......
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