summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-toggle/parsing/support/toggle-root-values.js
blob: de2061107a72e46905363f46a1c26ba290b1cf66 (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
104
105
106
107
function test_toggle_root_computed_values(property) {
  test_computed_value(property, 'none');
  test_computed_value(property, 'sticky sticky');
  test_computed_value(property, 'group group');
  test_computed_value(property, 'self self');
  test_computed_value(property, 'mytoggle');
  test_computed_value(property, 'mytoggle, yourtoggle');
  test_computed_value(property, 'mytoggle, mytoggle');
  test_computed_value(property, 'mytoggle 3 at 0 sticky self, yourtoggle 1 group self', 'mytoggle 3 sticky self, yourtoggle group self');
  test_computed_value(property, 'mytoggle 3 at 1 sticky self, yourtoggle 2 group self');
  test_computed_value(property, 'mytoggle 1 at 0', 'mytoggle');
  test_computed_value(property, 'mytoggle 1 at +0', 'mytoggle');
  test_computed_value(property, 'mytoggle +1 at 0', 'mytoggle');
  test_computed_value(property, 'mytoggle 1 at -0', 'mytoggle');
  test_computed_value(property, 'mytoggle +1 at 2', 'mytoggle 1 at 2');
  test_computed_value(property, 'mytoggle 1 at calc(-3)', 'mytoggle');
  test_computed_value(property, 'mytoggle calc(-3) at 0', 'mytoggle');
  test_computed_value(property, 'mytoggle 7 at calc(-3)', 'mytoggle 7');
  test_computed_value(property, 'mytoggle calc(-3) at 7', 'mytoggle 1 at 7');
  test_computed_value(property, 'mytoggle calc(9) at calc(6)', 'mytoggle 9 at 6');
  test_computed_value(property, 'mytoggle calc(9.6) at calc(6.4)', 'mytoggle 10 at 6');
  test_computed_value(property, 'mytoggle calc(-9.5) at calc(6.5)', 'mytoggle 1 at 7');
  test_computed_value(property, 'mytoggle group sticky self, yourtoggle self sticky', 'mytoggle sticky group self, yourtoggle sticky self');
  test_computed_value(property, 'mytoggle group 2 at 1', 'mytoggle 2 at 1 group');
  test_computed_value(property, 'mytoggle [one two]');
  test_computed_value(property, 'mytoggle [one two three]');
  test_computed_value(property, 'mytoggle [one two three] at 0', 'mytoggle [one two three]');
  test_computed_value(property, 'mytoggle [ one two three ] at 0', 'mytoggle [one two three]');
  test_computed_value(property, 'mytoggle[one two three]at 0', 'mytoggle [one two three]');
  test_computed_value(property, 'mytoggle [one two three] at 1');
  test_computed_value(property, 'mytoggle [ one two three ] at 1', 'mytoggle [one two three] at 1');
  test_computed_value(property, 'mytoggle[one two three]at 1', 'mytoggle [one two three] at 1');
  test_computed_value(property, 'mytoggle [ one two three ] at two', 'mytoggle [one two three] at two');
  test_computed_value(property, 'mytoggle 3 at two');
}

function test_toggle_root_valid_values(property) {
  test_valid_value(property, 'none');
  test_valid_value(property, 'sticky sticky');
  test_valid_value(property, 'group group');
  test_valid_value(property, 'self self');
  test_valid_value(property, 'mytoggle');
  test_valid_value(property, 'mytoggle, yourtoggle');
  test_valid_value(property, 'mytoggle, mytoggle');
  test_valid_value(property, 'mytoggle 3 at 0 sticky self, yourtoggle 1 group self');
  test_valid_value(property, 'mytoggle 1 at 0');
  test_valid_value(property, 'mytoggle 1 at +0', 'mytoggle 1 at 0');
  test_valid_value(property, 'mytoggle +1 at 0', 'mytoggle 1 at 0');
  test_valid_value(property, 'mytoggle 1 at -0', 'mytoggle 1 at 0');
  test_valid_value(property, 'mytoggle 1 at calc(-3)');
  test_valid_value(property, 'mytoggle calc(-3) at 0');
  test_valid_value(property, 'mytoggle 7 at calc(-3)');
  test_valid_value(property, 'mytoggle calc(-3) at 7');
  test_valid_value(property, 'mytoggle calc(9) at calc(6)');
  test_valid_value(property, 'mytoggle calc(9.6) at calc(6.4)');
  test_valid_value(property, 'mytoggle calc(-9.5) at calc(6.5)');
  test_valid_value(property, 'mytoggle group sticky self, yourtoggle self sticky', 'mytoggle sticky group self, yourtoggle sticky self');
  test_valid_value(property, 'mytoggle group 2 at 1', 'mytoggle 2 at 1 group');
  test_valid_value(property, 'mytoggle [one two]');
  test_valid_value(property, 'mytoggle [one two three]');
  test_valid_value(property, 'mytoggle [one two three] at 0');
  test_valid_value(property, 'mytoggle [ one two three ] at 0', 'mytoggle [one two three] at 0');
  test_valid_value(property, 'mytoggle[one two three]at 0', 'mytoggle [one two three] at 0');
  test_valid_value(property, 'mytoggle [ one two three ] at two', 'mytoggle [one two three] at two');
  test_valid_value(property, 'mytoggle 3 at two');
}

function test_toggle_root_invalid_values(property) {
  test_invalid_value(property, 'none 1');
  test_invalid_value(property, 'none sticky');
  test_invalid_value(property, 'none cycle');
  test_invalid_value(property, 'none cycle-on');
  test_invalid_value(property, 'none group');
  test_invalid_value(property, 'none self');
  test_invalid_value(property, 'None self');
  test_invalid_value(property, 'NONE self');
  test_invalid_value(property, 'mytoggle sticky sticky');
  test_invalid_value(property, 'mytoggle group group');
  test_invalid_value(property, 'mytoggle self self');
  test_invalid_value(property, 'none sticky sticky');
  test_invalid_value(property, 'none group group');
  test_invalid_value(property, 'none self self');
  test_invalid_value(property, 'none, mytoggle');
  test_invalid_value(property, 'mytoggle, none');
  test_invalid_value(property, 'mytoggle 1 at');
  test_invalid_value(property, 'mytoggle []');
  test_invalid_value(property, 'mytoggle [one]');
  test_invalid_value(property, 'mytoggle [one two] at');
  test_invalid_value(property, 'mytoggle [one two two three]');
  test_invalid_value(property, 'mytoggle [one two one three]');
  test_invalid_value(property, 'mytoggle 0 sticky self');
  test_invalid_value(property, 'mytoggle 0 at 0 sticky self');
  test_invalid_value(property, 'mytoggle -1 at 1 sticky self');
  test_invalid_value(property, 'mytoggle 1 at -1 sticky self');
  test_invalid_value(property, 'mytoggle -1 at -1 sticky self');
  test_invalid_value(property, 'mytoggle -1 at 0');
  test_invalid_value(property, 'mytoggle 0 at 0');
  test_invalid_value(property, 'mytoggle -0 at 0');
  test_invalid_value(property, 'mytoggle +0 at 0');
  test_invalid_value(property, 'mytoggle sticky 3 at 1 group self sticky');
  test_invalid_value(property, 'mytoggle sticky 3 at 1 group self group');
  test_invalid_value(property, 'mytoggle sticky 3 at 1 group self self');
  test_invalid_value(property, 'mytoggle sticky 3 at 1 group self 1');
  test_invalid_value(property, 'mytoggle sticky group at 1');
  test_invalid_value(property, 'mytoggle sticky group at 1 1');
}