diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /testing/web-platform/tests/scroll-animations/css/animation-shorthand.html | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/scroll-animations/css/animation-shorthand.html')
-rw-r--r-- | testing/web-platform/tests/scroll-animations/css/animation-shorthand.html | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/testing/web-platform/tests/scroll-animations/css/animation-shorthand.html b/testing/web-platform/tests/scroll-animations/css/animation-shorthand.html new file mode 100644 index 0000000000..7bd17b9919 --- /dev/null +++ b/testing/web-platform/tests/scroll-animations/css/animation-shorthand.html @@ -0,0 +1,142 @@ +<!DOCTYPE html> +<link rel="help" href="https://drafts.csswg.org/css-animations-2/#animation-shorthand"> +<link rel="help" href="https://drafts.csswg.org/css-animations-2/#animation-timeline"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +<script src="/css/support/shorthand-testcommon.js"></script> +<div id="target"></div> +<script> +test_valid_value('animation', + '1s linear 1s 2 reverse forwards paused anim'); + +test_invalid_value('animation', + '1s linear 1s 2 reverse forwards paused anim initial'); +test_invalid_value('animation', + '1s linear 1s 2 reverse forwards paused anim 2000'); +test_invalid_value('animation', + '1s linear 1s 2 reverse forwards paused anim scroll()'); +test_invalid_value('animation', + '1s linear 1s 2 reverse forwards paused anim view()'); +test_invalid_value('animation', + '1s linear 1s 2 reverse forwards paused anim timeline'); + +test_computed_value('animation', + '1s linear 1s 2 reverse forwards paused anim'); + +test_shorthand_value('animation', + `1s linear 1s 2 reverse forwards paused anim1, + 1s linear 1s 2 reverse forwards paused anim2, + 1s linear 1s 2 reverse forwards paused anim3`, +{ + 'animation-duration': '1s, 1s, 1s', + 'animation-timing-function': 'linear, linear, linear', + 'animation-delay': '1s, 1s, 1s', + 'animation-iteration-count': '2, 2, 2', + 'animation-direction': 'reverse, reverse, reverse', + 'animation-fill-mode': 'forwards, forwards, forwards', + 'animation-play-state': 'paused, paused, paused', + 'animation-name': 'anim1, anim2, anim3', + 'animation-timeline': 'auto, auto, auto', + 'animation-range-start': 'normal, normal, normal', + 'animation-range-end': 'normal, normal, normal', +}); + +test((t) => { + t.add_cleanup(() => { + target.style = ''; + }); + + target.style.animation = 'anim 1s'; + target.style.animationTimeline = 'timeline'; + assert_equals(target.style.animation, ''); + assert_equals(target.style.animationName, 'anim'); + assert_equals(target.style.animationDuration, '1s'); +}, 'Animation shorthand can not represent non-initial timelines (specified)'); + +test((t) => { + t.add_cleanup(() => { + target.style = ''; + }); + + target.style.animation = 'anim 1s'; + target.style.animationTimeline = 'timeline'; + assert_equals(getComputedStyle(target).animation, ''); + assert_equals(getComputedStyle(target).animationName, 'anim'); + assert_equals(getComputedStyle(target).animationDuration, '1s'); +}, 'Animation shorthand can not represent non-initial timelines (computed)'); + +test((t) => { + t.add_cleanup(() => { + target.style = ''; + }); + + target.style.animation = 'anim 1s'; + target.style.animationDelayEnd = '42s'; + assert_equals(target.style.animation, ''); + assert_equals(target.style.animationName, 'anim'); + assert_equals(target.style.animationDuration, '1s'); +}, 'Animation shorthand can not represent non-initial animation-delay-end (specified)'); + +test((t) => { + t.add_cleanup(() => { + target.style = ''; + }); + + target.style.animation = 'anim 1s'; + target.style.animationDelayEnd = '42s'; + assert_equals(getComputedStyle(target).animation, ''); + assert_equals(getComputedStyle(target).animationName, 'anim'); + assert_equals(getComputedStyle(target).animationDuration, '1s'); +}, 'Animation shorthand can not represent non-initial animation-delay-end (computed)'); + +test((t) => { + t.add_cleanup(() => { + target.style = ''; + }); + + target.style.animation = 'anim 1s'; + target.style.animationRangeStart = 'entry'; + assert_equals(target.style.animation, ''); + assert_equals(target.style.animationName, 'anim'); + assert_equals(target.style.animationDuration, '1s'); +}, 'Animation shorthand can not represent non-initial animation-range-start (specified)'); + +test((t) => { + t.add_cleanup(() => { + target.style = ''; + }); + + target.style.animation = 'anim 1s'; + target.style.animationRangeStart = 'entry'; + assert_equals(getComputedStyle(target).animation, ''); + assert_equals(getComputedStyle(target).animationName, 'anim'); + assert_equals(getComputedStyle(target).animationDuration, '1s'); +}, 'Animation shorthand can not represent non-initial animation-range-start (computed)'); + +test((t) => { + t.add_cleanup(() => { + target.style = ''; + }); + + target.style.animation = 'anim 1s'; + target.style.animationRangeEnd = 'entry'; + assert_equals(target.style.animation, ''); + assert_equals(target.style.animationName, 'anim'); + assert_equals(target.style.animationDuration, '1s'); +}, 'Animation shorthand can not represent non-initial animation-range-end (specified)'); + +test((t) => { + t.add_cleanup(() => { + target.style = ''; + }); + + target.style.animation = 'anim 1s'; + target.style.animationRangeEnd = 'entry'; + assert_equals(getComputedStyle(target).animation, ''); + assert_equals(getComputedStyle(target).animationName, 'anim'); + assert_equals(getComputedStyle(target).animationDuration, '1s'); +}, 'Animation shorthand can not represent non-initial animation-range-end (computed)'); + +</script> |