From e7a54e75a6e440da33267a9841bc05da1e90a1c4 Mon Sep 17 00:00:00 2001 From: Olga Gerchikov Date: Wed, 26 Feb 2020 10:40:27 +0000 Subject: [PATCH] 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 Reviewed-by: Majid Valipour Cr-Commit-Position: refs/heads/master@{#744037} -- wpt-commits: 9b38d0ac614a4132804b076c461738871689fae7 wpt-pr: 21585 --- .../scroll-animations/scroll-animation.html | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/testing/web-platform/tests/scroll-animations/scroll-animation.html b/testing/web-platform/tests/scroll-animations/scroll-animation.html index 7a6f87574403..62e5bb854aa2 100644 --- a/testing/web-platform/tests/scroll-animations/scroll-animation.html +++ b/testing/web-platform/tests/scroll-animations/scroll-animation.html @@ -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.'); \ No newline at end of file