Commit 73b9e0f4 authored by Stephen McGruer's avatar Stephen McGruer Committed by Commit Bot

Fix IsCurrent to return after-phase animations with negative playback rate

See https://drafts.csswg.org/web-animations-1/#current

Bug: 1005852
Change-Id: I76390e0bc99078b5c1644970ef1985492414e6e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1814638
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: default avatarKevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699779}
parent adb1cc93
...@@ -223,7 +223,9 @@ Timing::CalculatedTiming Timing::CalculateTimings( ...@@ -223,7 +223,9 @@ Timing::CalculatedTiming Timing::CalculateTimings(
// https://drafts.csswg.org/web-animations-1/#current // https://drafts.csswg.org/web-animations-1/#current
calculated.is_current = calculated.is_in_play || calculated.is_current = calculated.is_in_play ||
(playback_rate.has_value() && playback_rate > 0 && (playback_rate.has_value() && playback_rate > 0 &&
calculated.phase == Timing::kPhaseBefore); calculated.phase == Timing::kPhaseBefore) ||
(playback_rate.has_value() && playback_rate < 0 &&
calculated.phase == Timing::kPhaseAfter);
calculated.local_time = local_time; calculated.local_time = local_time;
calculated.time_to_next_iteration = time_to_next_iteration; calculated.time_to_next_iteration = time_to_next_iteration;
......
...@@ -12,7 +12,7 @@ PASS Returns finished animations that fill forwards ...@@ -12,7 +12,7 @@ PASS Returns finished animations that fill forwards
PASS Returns animations yet to reach their active phase PASS Returns animations yet to reach their active phase
PASS Does not return reversed finished animations that do not fill backwards PASS Does not return reversed finished animations that do not fill backwards
PASS Returns reversed finished animations that fill backwards PASS Returns reversed finished animations that fill backwards
FAIL Returns reversed animations yet to reach their active phase assert_array_equals: lengths differ, expected 1 got 0 PASS Returns reversed animations yet to reach their active phase
PASS Does not return animations with zero playback rate in before phase PASS Does not return animations with zero playback rate in before phase
PASS Does not return animations with zero playback rate in after phase PASS Does not return animations with zero playback rate in after phase
PASS Returns animations based on dynamic changes to individual animations' duration PASS Returns animations based on dynamic changes to individual animations' duration
......
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