Commit 02de1dcf authored by Stephen McGruer's avatar Stephen McGruer Committed by Commit Bot

Web Animations: Properly report ComputedEffectTime::localTime

The localTime should still be reported when the timing is not in effect.

Bug: 827613
Change-Id: I3ed29988ed0869a5261e0d756f7fbc94c24f3d4c
Reviewed-on: https://chromium-review.googlesource.com/989655Reviewed-by: default avatarXida Chen <xidachen@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547699}
parent e75bffaa
This is a testharness.js-based test.
FAIL Local time is current time for animation effects associated with an animation assert_equals: expected (number) -1000 but got (object) null
PASS Local time is unresolved for animation effects not associated with an animation
Harness: the test ran to completion.
...@@ -106,12 +106,16 @@ void AnimationEffect::getComputedTiming( ...@@ -106,12 +106,16 @@ void AnimationEffect::getComputedTiming(
computed_timing.setEndTime(EndTimeInternal() * 1000); computed_timing.setEndTime(EndTimeInternal() * 1000);
computed_timing.setActiveDuration(ActiveDurationInternal() * 1000); computed_timing.setActiveDuration(ActiveDurationInternal() * 1000);
if (EnsureCalculated().is_in_effect) { if (IsNull(EnsureCalculated().local_time)) {
computed_timing.setLocalTimeToNull();
} else {
computed_timing.setLocalTime(EnsureCalculated().local_time * 1000); computed_timing.setLocalTime(EnsureCalculated().local_time * 1000);
}
if (EnsureCalculated().is_in_effect) {
computed_timing.setProgress(EnsureCalculated().progress.value()); computed_timing.setProgress(EnsureCalculated().progress.value());
computed_timing.setCurrentIteration(EnsureCalculated().current_iteration); computed_timing.setCurrentIteration(EnsureCalculated().current_iteration);
} else { } else {
computed_timing.setLocalTimeToNull();
computed_timing.setProgressToNull(); computed_timing.setProgressToNull();
computed_timing.setCurrentIterationToNull(); computed_timing.setCurrentIterationToNull();
} }
......
...@@ -166,7 +166,7 @@ class CORE_EXPORT AnimationEffect : public ScriptWrappable { ...@@ -166,7 +166,7 @@ class CORE_EXPORT AnimationEffect : public ScriptWrappable {
bool is_current; bool is_current;
bool is_in_effect; bool is_in_effect;
bool is_in_play; bool is_in_play;
double local_time; double local_time = NullValue();
double time_to_forwards_effect_change; double time_to_forwards_effect_change;
double time_to_reverse_effect_change; double time_to_reverse_effect_change;
} calculated_; } calculated_;
......
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