Commit 79f6cff0 authored by Jordan Taylor's avatar Jordan Taylor Committed by Commit Bot

Animation effect now remains after timeline goes inactive while paused

This issue was fixed in the following CL by changing the calculation
for inherited_time that gets passed to effects in Animation::Update.

https://chromium-review.googlesource.com/c/chromium/src/+/2092188

This CL is adding test coverage for the issue. It has been verified
to fail without the above changes.

Bug: 1082504
Change-Id: I4a15a0dcd23f351fd5fb9e659693d6c803937360
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2393059
Commit-Queue: Jordan Taylor <jortaylo@microsoft.com>
Reviewed-by: default avatarKevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805863}
parent af8c6b8c
......@@ -314,4 +314,38 @@ promise_test(async t => {
);
}, 'Make scroller inactive, then set current time to an in range time');
promise_test(async t => {
const animation = new Animation(
createKeyframeEffectOpacity(t),
createScrollTimelineWithOffsets(t, "20%", "80%")
);
const scroller = animation.timeline.scrollSource;
const maxScroll = scroller.scrollHeight - scroller.clientHeight;
scroller.scrollTop = 0.5 * maxScroll;
// allow the scroll to finish.
await waitForNextFrame();
animation.pause();
await animation.ready;
// verify effect is applied.
const expected_progress = 0.5;
assert_equals(
animation.effect.getComputedTiming().progress,
expected_progress,
"Verify effect progress after pausing."
);
// cause the timeline to become inactive
scroller.style.overflow = 'visible';
await waitForAnimationFrames(2);
assert_equals(animation.timeline.currentTime, null,
'Sanity check the timeline is inactive.');
assert_equals(
animation.effect.getComputedTiming().progress,
expected_progress,
"Verify effect progress after the timeline goes inactive."
);
}, 'Animation effect is still applied after pausing and making timeline ' +
'inactive.');
</script>
\ No newline at end of file
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