From ac8101fb690912ecf7a3207dca11f738891a783a Mon Sep 17 00:00:00 2001 From: Jordan Taylor Date: Thu, 12 Nov 2020 21:52:24 +0000 Subject: [PATCH] Bug 1676761 [wpt PR 26142] - Initial implementation of progress based ScrollTimelines, a=testonly Automatic update from web-platform-tests Initial implementation of progress based ScrollTimelines This work is the first step in implementing upcoming spec change in: https://github.com/w3c/csswg-drafts/issues/4862 Converted AnimationTimeline::currentTime() to CSSNumberish Added AnimationTimeline::duration Bug: 1140602 Change-Id: I5c9b8b7130b91faae5f172493ba5f55d77b4bdd6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2476900 Commit-Queue: Jordan Taylor Reviewed-by: Robert Flack Cr-Commit-Position: refs/heads/master@{#826533} -- wpt-commits: d494b8ec23759c6bfb747bee1ff3a1b3d67f5177 wpt-pr: 26142 --- .../progress-based-current-time.tenative.html | 501 ++++++++++++++++++ .../tests/scroll-animations/testcommon.js | 8 + 2 files changed, 509 insertions(+) create mode 100644 testing/web-platform/tests/scroll-animations/progress-based-current-time.tenative.html diff --git a/testing/web-platform/tests/scroll-animations/progress-based-current-time.tenative.html b/testing/web-platform/tests/scroll-animations/progress-based-current-time.tenative.html new file mode 100644 index 0000000000000..8a8ccfcff8b2b --- /dev/null +++ b/testing/web-platform/tests/scroll-animations/progress-based-current-time.tenative.html @@ -0,0 +1,501 @@ + + +ScrollTimeline current time algorithm + + + + + + + + + + diff --git a/testing/web-platform/tests/scroll-animations/testcommon.js b/testing/web-platform/tests/scroll-animations/testcommon.js index d9fc153887c5f..9b3e82228fcdb 100644 --- a/testing/web-platform/tests/scroll-animations/testcommon.js +++ b/testing/web-platform/tests/scroll-animations/testcommon.js @@ -55,3 +55,11 @@ function assert_approx_equals_or_null(actual, expected, tolerance, name){ assert_approx_equals(actual, expected, tolerance, name); } } + +// actual should be a CSSUnitValue and expected should be a double value 0-100 +function assert_percent_css_unit_value_approx_equals(actual, expected, tolerance, name){ + assert_true(actual instanceof CSSUnitValue, "'actual' must be of type CSSUnitValue"); + assert_equals(typeof expected, "number", "'expected' should be a number (0-100)"); + assert_equals(actual.unit, "percent", "'actual' unit type must be 'percent'"); + assert_approx_equals(actual.value, expected, tolerance, name); +} \ No newline at end of file