Bug 1613253 [wpt PR 21585] - Fixed initialization of animation hold time when scroll timeline is inactive, a=testonly
authorOlga Gerchikov <gerchiko@microsoft.com>
Wed, 26 Feb 2020 10:40:27 +0000
changeset 515792 859a7bb88b6346c0a8e527ba8ac6a7d263fc74ec
parent 515791 4de181fb852b1e3babe9457f46e2dc98100b8c4a
child 515793 98d2c9e64a16b5dbe44ce6b4941824ea29433546
push id37162
push usernbeleuzu@mozilla.com
push dateThu, 27 Feb 2020 09:49:56 +0000
treeherdermozilla-central@9e8d5431c412 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1613253, 21585, 1945923, 1042924, 2037348, 744037
milestone75.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
testing/web-platform/tests/scroll-animations/scroll-animation.html
--- a/testing/web-platform/tests/scroll-animations/scroll-animation.html
+++ b/testing/web-platform/tests/scroll-animations/scroll-animation.html
@@ -130,9 +130,33 @@ promise_test(async t => {
     assert_equals(animation1.startTime, 0,
       "The start time is zero in Playing state.");
     assert_equals(animation2.currentTime, timeline.currentTime,
       "The current corresponds to the scroll position of the scroller.");
     assert_equals(animation2.startTime, 0,
       "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>
\ No newline at end of file