Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Unified Diff: third_party/WebKit/LayoutTests/web-animations-api/fill-forward-negative-end-delay.html

Issue 2030843002: Web Animations: Account for end delay in after phase active time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add headers Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/web-animations-api/fill-forward-negative-end-delay.html
diff --git a/third_party/WebKit/LayoutTests/web-animations-api/fill-forward-negative-end-delay.html b/third_party/WebKit/LayoutTests/web-animations-api/fill-forward-negative-end-delay.html
new file mode 100644
index 0000000000000000000000000000000000000000..fac0d47308293835415195eb37f398c679e4e292
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/web-animations-api/fill-forward-negative-end-delay.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Tests for effect clipping via negative end delay</title>
+<link rel="help" href="http://w3c.github.io/web-animations/#calculating-the-active-time">
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../imported/wpt/web-animations/testcommon.js"></script>
+<body>
+<script>
+'use strict';
+
+test(function(t) {
+ var animation = createDiv(t).animate(null, {
+ fill: 'forwards',
+ duration: 1,
+ endDelay: -1,
+ });
+ animation.currentTime = 10;
+ assert_equals(animation.effect.getComputedTiming().progress, 0,
+ 'Progress should be zero since we clip to the start of the animation');
+}, 'Negative end delay clipping into the start of the animation');
+
+test(function(t) {
+ var animation = createDiv(t).animate(null, {
+ fill: 'forwards',
+ duration: 1,
+ iterations: 2,
+ endDelay: -1,
+ });
+ animation.currentTime = 10;
+ assert_equals(animation.effect.getComputedTiming().progress, 1,
+ 'Progress should be 1 since we clip to the end of the first iteration ' +
+ 'and the second iteration does not have a chance to start');
+}, 'Negative end delay clipping to the end of the the first iteration');
+
+test(function(t) {
+ var animation = createDiv(t).animate(null, {
+ fill: 'forwards',
+ duration: 1,
+ iterations: 2,
+ endDelay: -0.75,
+ });
+ animation.currentTime = 10;
+ assert_equals(animation.effect.getComputedTiming().progress, 0.25,
+ 'Progress should be 0.25 since we clip part way through the second iteration');
+}, 'Negative end delay clipping part way into the second iteration');
+
+test(function(t) {
+ var animation = createDiv(t).animate(null, {
+ fill: 'forwards',
+ duration: 1,
+ iterations: 0,
+ endDelay: -1,
+ });
+ animation.currentTime = 10;
+ assert_equals(animation.effect.getComputedTiming().progress, 0,
+ 'Progress should be 0 since there are no iterations to make progress in');
+}, 'Negative end delay clipping into zero iterations');
+
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698