diff --git a/css/css-animations/AnimationEffect-getComputedTiming.tentative.html b/css/css-animations/AnimationEffect-getComputedTiming.tentative.html index 46c26fcb99be0f..def5a6e8aa8b2f 100644 --- a/css/css-animations/AnimationEffect-getComputedTiming.tentative.html +++ b/css/css-animations/AnimationEffect-getComputedTiming.tentative.html @@ -54,6 +54,54 @@ 'Initial value of endDelay'); }, 'endDelay of a new animation'); +test(t => { + const div = addDiv(t, { style: 'animation: moveAnimation 100s; animation-delay-start: 10s' }); + const effect = div.getAnimations()[0].effect; + assert_equals(effect.getComputedTiming().delay, 10 * MS_PER_SEC, + 'animation-delay-start maps to delay'); +}, 'animation-delay-start maps to delay'); + +test(t => { + const div = addDiv(t, { style: 'animation: moveAnimation 100s; animation-delay-end: 5s' }); + const effect = div.getAnimations()[0].effect; + assert_equals(effect.getComputedTiming().endDelay, 5 * MS_PER_SEC, + 'animation-delay-end maps to endDelay'); +}, 'animation-delay-end maps to endDelay'); + +test(t => { + const div = addDiv(t, { style: 'animation: moveAnimation 100s; animation-delay: 2s 8s' }); + const effect = div.getAnimations()[0].effect; + assert_equals(effect.getComputedTiming().delay, 2 * MS_PER_SEC, + 'Two-value animation-delay start component'); + assert_equals(effect.getComputedTiming().endDelay, 8 * MS_PER_SEC, + 'Two-value animation-delay end component'); +}, 'Two-value animation-delay maps to delay and endDelay'); + +test(t => { + const div = addDiv(t, { style: 'animation: moveAnimation 100s; animation-delay-end: 5s' }); + div.style.animationDelay = '2s'; + const effect = div.getAnimations()[0].effect; + assert_equals(effect.getComputedTiming().delay, 2 * MS_PER_SEC, + 'Single-value animation-delay updates delay'); + assert_equals(effect.getComputedTiming().endDelay, 5 * MS_PER_SEC, + 'Single-value animation-delay leaves endDelay unchanged'); +}, 'Single-value animation-delay updates start delay only'); + +test(t => { + const div = addDiv(t, { style: 'animation: moveAnimation 100s; animation-delay-end: 20s' }); + const effect = div.getAnimations()[0].effect; + assert_equals(effect.getComputedTiming().endTime, 120 * MS_PER_SEC, + 'endTime includes positive endDelay'); +}, 'endTime includes positive endDelay'); + +test(t => { + const div = addDiv(t, { style: 'animation: moveAnimation 100s; animation-delay-start: -5s' }); + const effect = div.getAnimations()[0].effect; + const answer = (100 - 5) * MS_PER_SEC; + assert_equals(effect.getComputedTiming().endTime, answer, + 'endTime reflects negative start delay'); +}, 'endTime reflects negative animation-delay-start'); + // -------------------- // fill diff --git a/css/css-animations/AnimationEffect-updateTiming.tentative.html b/css/css-animations/AnimationEffect-updateTiming.tentative.html index e6556dac4bde9f..f01c2a37f3db6c 100644 --- a/css/css-animations/AnimationEffect-updateTiming.tentative.html +++ b/css/css-animations/AnimationEffect-updateTiming.tentative.html @@ -42,7 +42,8 @@ // // iterations - animation-iteration-count // direction - animation-direction -// delay - animation-delay +// delay - animation-delay-start +// endDelay - animation-delay-end // fill - animation-fill-mode // // Which we test in two batches, overriding two properties each time and using @@ -117,7 +118,53 @@ 'Direction should be the value set by style' ); }, 'AnimationEffect.updateTiming({ delay, fill }) causes changes to' - + ' the animation-delay and animation-fill-mode to be ignored'); + + ' the animation-delay-start and animation-fill-mode to be ignored'); + +test(t => { + const div = addDiv(t); + div.style.animation = 'anim-empty 100s'; + + const animation = div.getAnimations()[0]; + animation.effect.updateTiming({ endDelay: 2 * MS_PER_SEC }); + + div.style.animationDelayEnd = '4s'; + div.style.animationDelayStart = '6s'; + + assert_equals( + animation.effect.getTiming().endDelay, + 2 * MS_PER_SEC, + 'End delay should be the value set by the API' + ); + assert_equals( + animation.effect.getTiming().delay, + 6 * MS_PER_SEC, + 'Start delay should be the value set by style' + ); +}, 'AnimationEffect.updateTiming({ endDelay }) causes changes to' + + ' the animation-delay-end to be ignored'); + +test(t => { + const div = addDiv(t); + div.style.animation = 'anim-empty 100s'; + + const animation = div.getAnimations()[0]; + animation.effect.updateTiming({ delay: 2 * MS_PER_SEC }); + + div.style.animationDelayStart = '4s'; + div.style.animationDelayEnd = '6s'; + + assert_equals( + animation.effect.getTiming().delay, + 2 * MS_PER_SEC, + 'Start delay should be the value set by the API' + ); + assert_equals( + animation.effect.getTiming().endDelay, + 6 * MS_PER_SEC, + 'End delay should be the value set by style' + ); +}, 'AnimationEffect.updateTiming({ delay }) causes changes to' + + ' the animation-delay-start to be ignored'); test(t => { const div = addDiv(t); @@ -145,27 +192,27 @@ const animation = div.getAnimations()[0]; animation.effect.updateTiming({ easing: 'steps(4)', - endDelay: 2 * MS_PER_SEC, iterationStart: 4, }); div.style.animationDuration = '6s'; div.style.animationTimingFunction = 'ease-in'; + div.style.animationDelayEnd = '8s'; assert_equals( animation.effect.getTiming().easing, 'steps(4)', - 'endDelay should be the value set by the API' - ); - assert_equals( - animation.effect.getTiming().endDelay, - 2 * MS_PER_SEC, - 'endDelay should be the value set by the API' + 'easing should be the value set by the API' ); assert_equals( animation.effect.getTiming().iterationStart, 4, - 'iterationStart should be the value set by style' + 'iterationStart should be the value set by the API' + ); + assert_equals( + animation.effect.getTiming().endDelay, + 8 * MS_PER_SEC, + 'endDelay should be the value set by style' ); }, 'AnimationEffect properties that do not map to animation-* properties' + ' should not be changed when animation-* style is updated'); diff --git a/css/css-animations/CSSAnimation-effect.tentative.html b/css/css-animations/CSSAnimation-effect.tentative.html index 591ffe770b65ed..32728cd9a37eda 100644 --- a/css/css-animations/CSSAnimation-effect.tentative.html +++ b/css/css-animations/CSSAnimation-effect.tentative.html @@ -166,7 +166,8 @@ div.style.animationDuration = '4s'; div.style.animationIterationCount = '6'; div.style.animationDirection = 'reverse'; - div.style.animationDelay = '8s'; + div.style.animationDelayStart = '8s'; + div.style.animationDelayEnd = '12s'; div.style.animationFillMode = 'both'; div.style.animationPlayState = 'paused'; div.style.animationComposition = 'add'; @@ -197,6 +198,11 @@ 0, 'delay should be the value set by the API' ); + assert_equals( + animation.effect.getTiming().endDelay, + 0, + 'endDelay should be the value set by the API' + ); assert_equals( animation.effect.getTiming().fill, 'auto', @@ -225,6 +231,19 @@ null, 'timeline should be the value set by style' ); + + div.style.animationDelayStart = '99s'; + div.style.animationDelayEnd = '99s'; + assert_equals( + animation.effect.getTiming().delay, + 0, + 'delay should remain the value set by the API after style change' + ); + assert_equals( + animation.effect.getTiming().endDelay, + 0, + 'endDelay should remain the value set by the API after style change' + ); }, 'Replacing the effect of a CSSAnimation causes subsequent changes to' + ' corresponding animation-* properties to be ignored'); diff --git a/css/css-animations/animation-delay-end-liveness-reverse.tentative.html b/css/css-animations/animation-delay-end-liveness-reverse.tentative.html new file mode 100644 index 00000000000000..81fa0ea12fbc2f --- /dev/null +++ b/css/css-animations/animation-delay-end-liveness-reverse.tentative.html @@ -0,0 +1,34 @@ + + +
Test passes if there is a filled green square and no red.
+ diff --git a/css/css-animations/animation-delay-start-liveness-001.tentative.html b/css/css-animations/animation-delay-start-liveness-001.tentative.html new file mode 100644 index 00000000000000..53059cb3d92fa0 --- /dev/null +++ b/css/css-animations/animation-delay-start-liveness-001.tentative.html @@ -0,0 +1,33 @@ + + + +