summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/scroll-animations/css/animation-timeline-parsing.html
blob: 4916f7726f910d56fad5c33dba7d1b6421fb6468 (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
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#animation-timeline">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<div id="target"></div>
<script>
test_valid_value('animation-timeline', 'initial');
test_valid_value('animation-timeline', 'inherit');
test_valid_value('animation-timeline', 'unset');
test_valid_value('animation-timeline', 'revert');
test_valid_value('animation-timeline', 'auto');
test_valid_value('animation-timeline', 'none');
test_valid_value('animation-timeline', 'auto, auto');
test_valid_value('animation-timeline', 'none, none');
test_valid_value('animation-timeline', 'auto, none');
test_valid_value('animation-timeline', 'none, auto');
test_valid_value('animation-timeline', 'test');
test_valid_value('animation-timeline', 'test1, test2');
test_valid_value('animation-timeline', 'test1, test2, none, test3, auto', ["test1, test2, none, test3, auto", 'test1, test2, none, test3, auto']);

test_invalid_value('animation-timeline', '10px');
test_invalid_value('animation-timeline', 'auto auto');
test_invalid_value('animation-timeline', 'none none');
test_invalid_value('animation-timeline', 'foo bar');
test_invalid_value('animation-timeline', '"foo" "bar"');
test_invalid_value('animation-timeline', 'rgb(1, 2, 3)');
test_invalid_value('animation-timeline', '#fefefe');
test_invalid_value('animation-timeline', '"test"');

// https://drafts.csswg.org/scroll-animations-1/#scroll-notation
//
// animation-timeline: scroll(<axis>? <scroller>?);
// <axis> = block | inline | vertical | horizontal
// <scroller> = root | nearest | self
test_valid_value('animation-timeline', 'scroll()');
test_valid_value('animation-timeline', 'scroll(block)', 'scroll()');
test_valid_value('animation-timeline', 'scroll(inline)');
test_valid_value('animation-timeline', 'scroll(horizontal)');
test_valid_value('animation-timeline', 'scroll(vertical)');
test_valid_value('animation-timeline', 'scroll(root)');
test_valid_value('animation-timeline', 'scroll(nearest)', 'scroll()');
test_valid_value('animation-timeline', 'scroll(self)');
test_valid_value('animation-timeline', 'scroll(inline nearest)', 'scroll(inline)');
test_valid_value('animation-timeline', 'scroll(nearest inline)', 'scroll(inline)');
test_valid_value('animation-timeline', 'scroll(block self)', 'scroll(self)');
test_valid_value('animation-timeline', 'scroll(self block)', 'scroll(self)');
test_valid_value('animation-timeline', 'scroll(vertical root)', 'scroll(root vertical)');

test_invalid_value('animation-timeline', 'scroll(abc root)');
test_invalid_value('animation-timeline', 'scroll(abc)');
test_invalid_value('animation-timeline', 'scroll(vertical abc)');
test_invalid_value('animation-timeline', 'scroll("string")');

// https://drafts.csswg.org/scroll-animations-1/#view-notation
test_valid_value('animation-timeline', 'view()');
test_valid_value('animation-timeline', 'view(block)', 'view()');
test_valid_value('animation-timeline', 'view(inline)');
test_valid_value('animation-timeline', 'view(horizontal)');
test_valid_value('animation-timeline', 'view(vertical)');
test_valid_value('animation-timeline', 'view(vertical 1px 2px)');
test_valid_value('animation-timeline', 'view(vertical 1px)');
test_valid_value('animation-timeline', 'view(vertical auto)', 'view(vertical)');
test_valid_value('animation-timeline', 'view(vertical auto auto)', 'view(vertical)');
test_valid_value('animation-timeline', 'view(vertical auto 1px)');
test_valid_value('animation-timeline', 'view(1px 2px vertical)', 'view(vertical 1px 2px)');
test_valid_value('animation-timeline', 'view(1px vertical)', 'view(vertical 1px)');
test_valid_value('animation-timeline', 'view(auto horizontal)', 'view(horizontal)');
test_valid_value('animation-timeline', 'view(1px 2px)');
test_valid_value('animation-timeline', 'view(1px)');
test_valid_value('animation-timeline', 'view(1px 1px)', 'view(1px)');
test_valid_value('animation-timeline', 'view(1px auto)');
test_valid_value('animation-timeline', 'view(auto calc(1% + 1px))');
test_valid_value('animation-timeline', 'view(auto)', 'view()');
test_valid_value('animation-timeline', 'view(auto auto)', 'view()');

test_invalid_value('animation-timeline', 'view(vertical 1px 2px 3px)');
test_invalid_value('animation-timeline', 'view(1px vertical 3px)');
test_invalid_value('animation-timeline', 'view(1px 2px 3px)');
test_invalid_value('animation-timeline', 'view(abc block)');
test_invalid_value('animation-timeline', 'view(abc)');
test_invalid_value('animation-timeline', 'view(vertical abc)');
test_invalid_value('animation-timeline', 'view("string")');
</script>