Bug 1613253 [wpt PR 21585] - Fixed initialization of animation hold time when scroll timeline is inactive, a=testonly

Automatic update from web-platform-tests
Fixed initialization of animation hold time when scroll timeline is inactive

https://chromium-review.googlesource.com/c/chromium/src/+/1945923
change erroneously initializes hold_time_ to null when scroll
timeline is inactive. This makes assert to fail in
Animation::CommitPendingPlay at:
DCHECK(start_time_ || hold_time_);

Bug: 1042924
Change-Id: I98060d065da93bb633d6cbc1506c591194a11692
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037348
Commit-Queue: Olga Gerchikov <gerchiko@microsoft.com>
Reviewed-by: Majid Valipour <majidvp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744037}

--

wpt-commits: 9b38d0ac614a4132804b076c461738871689fae7
wpt-pr: 21585
This commit is contained in:
Olga Gerchikov 2020-02-26 10:40:27 +00:00 коммит произвёл moz-wptsync-bot
Родитель f678a6a648
Коммит e7a54e75a6
1 изменённых файлов: 24 добавлений и 0 удалений

Просмотреть файл

@ -135,4 +135,28 @@ promise_test(async t => {
"The start time is zero in Playing state.");
}, 'Animation start and current times are correct when multiple animations' +
' are attached to the same timeline.');
promise_test(async t => {
const animation = createScrollLinkedAnimation(t);
const scroller = animation.timeline.scrollSource;
// Make the scroll timeline inactive.
scroller.style.overflow = "visible";
// Trigger layout;
scroller.scrollTop;
assert_equals(animation.timeline.currentTime, null,
"Timeline current time is null in inactive state.");
// Play the animation when the timeline is inactive.
animation.play();
// Make the scroll timeline active.
scroller.style.overflow = "auto";
await animation.ready;
// Ready promise is resolved as a result of the timeline becoming active.
assert_equals(animation.timeline.currentTime, 0,
"Timeline current time is resolved in active state.");
assert_equals(animation.currentTime, 0,
"Animation current time is resolved when the animation is ready.");
assert_equals(animation.startTime, 0,
"Animation start time is resolved when the animation is ready.");
}, 'Animation start and current times are correct if scroll timeline is ' +
'activated after animation.play call.');
</script>