summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-animations/parsing/animation-delay-shorthand.html
blob: f09f0a948ca94a183c818d27c6dda6b65a16e6fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<title>animation-delay shorthand</title>
<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#propdef-animation-delay">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/shorthand-testcommon.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>

test_valid_value("animation-delay", "1s");
test_valid_value("animation-delay", "-1s");
test_valid_value("animation-delay", "1s 2s");
test_valid_value("animation-delay", "1s, 2s");
test_valid_value("animation-delay", "1s 2s, 3s");
test_valid_value("animation-delay", "1s, 2s 3s");
test_valid_value("animation-delay", "1s, 2s, 3s");

test_valid_value("animation-delay", "cover");
test_valid_value("animation-delay", "contain");
test_valid_value("animation-delay", "enter");
test_valid_value("animation-delay", "exit");
test_valid_value("animation-delay", "enter, exit");

test_valid_value("animation-delay", "enter 0% enter 100%", "enter");
test_valid_value("animation-delay", "exit 0% exit 100%", "exit");
test_valid_value("animation-delay", "cover 0% cover 100%", "cover");
test_valid_value("animation-delay", "contain 0% contain 100%", "contain");

test_valid_value("animation-delay", "cover 50%");
test_valid_value("animation-delay", "contain 50%");
test_valid_value("animation-delay", "enter 50%");
test_valid_value("animation-delay", "exit 50%");

test_valid_value("animation-delay", "enter 50% 0s", "enter 50%");
test_valid_value("animation-delay", "0s enter 50%");
test_valid_value("animation-delay", "enter 50% exit 50%");
test_valid_value("animation-delay", "cover 50% enter 50%, contain 50% exit 50%");

test_invalid_value("animation-delay", "1s 2s 3s");
test_invalid_value("animation-delay", "0s, 1s 2s 3s");
test_invalid_value("animation-delay", "1s / 2s");
test_invalid_value("animation-delay", "1s, 2px");
test_invalid_value("animation-delay", "#ff0000");
test_invalid_value("animation-delay", "red");
test_invalid_value("animation-delay", "thing");
test_invalid_value("animation-delay", "thing 0%");
test_invalid_value("animation-delay", "thing 42%");
test_invalid_value("animation-delay", "thing 100%");
test_invalid_value("animation-delay", "thing 100px");
test_invalid_value("animation-delay", "100% thing");

test_shorthand_value('animation-delay', '1s 2s', {
  'animation-delay-start': '1s',
  'animation-delay-end': '2s',
});

test_shorthand_value('animation-delay', '1s', {
  'animation-delay-start': '1s',
  'animation-delay-end': '0s',
});

test_shorthand_value('animation-delay', 'cover', {
  'animation-delay-start': 'cover 0%',
  'animation-delay-end': 'cover 100%',
});

test_shorthand_value('animation-delay', 'contain', {
  'animation-delay-start': 'contain 0%',
  'animation-delay-end': 'contain 100%',
});

test_shorthand_value('animation-delay', 'enter 10% exit 20%', {
  'animation-delay-start': 'enter 10%',
  'animation-delay-end': 'exit 20%',
});

test_shorthand_value('animation-delay', '1s 2s, 3s 4s', {
  'animation-delay-start': '1s, 3s',
  'animation-delay-end': '2s, 4s',
});

test_shorthand_value('animation-delay', '1s 2s, 3s, 4s 5s', {
  'animation-delay-start': '1s, 3s, 4s',
  'animation-delay-end': '2s, 0s, 5s',
});

test_shorthand_value('animation-delay', 'enter, exit', {
  'animation-delay-start': 'enter 0%, exit 0%',
  'animation-delay-end': 'enter 100%, exit 100%',
});

test_shorthand_value('animation-delay', 'enter 0%, exit', {
  'animation-delay-start': 'enter 0%, exit 0%',
  'animation-delay-end': '0s, exit 100%',
});

test_shorthand_value('animation-delay', 'enter 0% 1s, 2s exit 50%', {
  'animation-delay-start': 'enter 0%, 2s',
  'animation-delay-end': '1s, exit 50%',
});
</script>