Skip to content

Commit 65512f5

Browse files
Calme1709AtkinsSJ
authored andcommitted
LibWeb: Import CSS random function tests
1 parent cd09763 commit 65512f5

File tree

8 files changed

+746
-0
lines changed

8 files changed

+746
-0
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
Harness status: OK
2+
3+
Found 72 tests
4+
5+
4 Pass
6+
68 Fail
7+
Fail Property scale value 'random(1, 11)'
8+
Fail Property scale value 'random(--foo, 2, 12)'
9+
Fail Property scale value 'random(--foo element-shared, 3, 13)'
10+
Fail Property scale value 'random(element-shared --foo, 4, 14)'
11+
Fail Property scale value 'random(0, 10, 5)'
12+
Fail Property scale value 'random(--foo, 10, 20, 5)'
13+
Fail Property scale value 'random(--foo element-shared, 20, 30, 5)'
14+
Fail Property scale value 'random(element-shared --foo, 30, 40, 5)'
15+
Fail Property scale value 'random(100, 10)'
16+
Fail Property scale value 'random(-10, -100)'
17+
Fail Property scale value 'random(-100, -10)'
18+
Fail Property scale value 'random(40, 50, -5)'
19+
Fail Property scale value 'random(5 * 1, 30 / 2)'
20+
Fail Property scale value 'calc(2 * random(6, 16))'
21+
Fail Property scale value 'random(NaN, 100)'
22+
Fail Property scale value 'random(10, NaN)'
23+
Fail Property scale value 'random(NaN, NaN)'
24+
Fail Property scale value 'random(NaN, 100, 10)'
25+
Fail Property scale value 'random(10, NaN, 10)'
26+
Fail Property scale value 'random(NaN, NaN, 10)'
27+
Fail Property scale value 'random(NaN, 100, NaN)'
28+
Fail Property scale value 'random(10, NaN, NaN)'
29+
Fail Property scale value 'random(NaN, NaN, NaN)'
30+
Fail Property scale value 'random(10, 100, NaN)'
31+
Fail Property scale value 'calc(10 + random(NaN, 100))'
32+
Fail Property scale value 'calc(10 + random(10, NaN))'
33+
Fail Property scale value 'calc(10 + random(NaN, NaN))'
34+
Fail Property scale value 'calc(10 + random(NaN, 100, 10))'
35+
Fail Property scale value 'calc(10 + random(10, NaN, 10))'
36+
Fail Property scale value 'calc(10 + random(NaN, NaN, 10))'
37+
Fail Property scale value 'calc(10 + random(NaN, 100, NaN))'
38+
Fail Property scale value 'calc(10 + random(10, NaN, NaN))'
39+
Fail Property scale value 'calc(10 + random(NaN, NaN, NaN))'
40+
Fail Property scale value 'calc(10 + random(10, 100, NaN))'
41+
Fail Property scale value 'random(infinity, 100)'
42+
Fail Property scale value 'random(infinity, infinity)'
43+
Fail Property scale value 'random(infinity, 100, 10)'
44+
Fail Property scale value 'random(infinity, infinity, 10)'
45+
Fail Property scale value 'random(infinity, 100, infinity)'
46+
Fail Property scale value 'random(infinity, infinity, infinity)'
47+
Fail Property scale value 'calc(10 + random(infinity, 100))'
48+
Fail Property scale value 'calc(10 + random(infinity, infinity))'
49+
Fail Property scale value 'calc(10 + random(infinity, infinity, 10))'
50+
Fail Property scale value 'calc(10 + random(infinity, 100, infinity))'
51+
Fail Property scale value 'calc(10 + random(infinity, infinity, infinity))'
52+
Fail Property scale value 'calc(10 + random(infinity, 100, 10))'
53+
Fail Property scale value 'random(10, infinity)'
54+
Fail Property scale value 'random(10, infinity, 10)'
55+
Fail Property scale value 'random(10, infinity, infinity)'
56+
Fail Property scale value 'calc(10 + random(10, infinity))'
57+
Fail Property scale value 'calc(10 + random(10, infinity, 10))'
58+
Fail Property scale value 'calc(10 + random(10, infinity, infinity))'
59+
Fail Property scale value 'random(10, 100, infinity)'
60+
Fail Property scale value 'calc(10 + random(10, 100, infinity))'
61+
Fail Property scale value 'random(10, 100, -infinity)'
62+
Fail Property scale value 'calc(10 + random(10, 100, -infinity))'
63+
Fail Property scale value on pseudo element '::before' 'random(7, 17)'
64+
Fail Property scale value on pseudo element '::before' 'random(--bar, 8, 18)'
65+
Fail Property scale value on pseudo element '::before' 'random(element-shared, 9, 19)'
66+
Fail Property scale value on pseudo element '::before' 'random(element-shared --foo, 10, 20)'
67+
Fail Property translate value 'random(10%, 100%)'
68+
Fail Property translate value 'random(fixed random(1, 2), 10%, 100%)'
69+
Fail Property translate value 'random(fixed random(-2, -1), 10%, 100%)'
70+
Fail Maximum random: 'random(a, b)'
71+
Fail Maximum random - shorthand: random(a, b))
72+
Fail Shared by name within an element: 'random(--identifier, a, b)'
73+
Pass Shared by name within an element - shorthand: random(--identifier, a, b))
74+
Pass Shared between elements within a property: random(element-shared, a, b)
75+
Pass Shared between elements within a property - shorthand: random(element-shared, a, b))
76+
Fail Shared globally: random(--identifier element-shared, a, b)
77+
Pass Shared globally - shorthand: random(element-shared, a, b))
78+
Fail Fixed: random(fixed <number>, a, b)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Harness status: OK
2+
3+
Found 1 tests
4+
5+
1 Fail
6+
Fail random() is not ignored in keyframe
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Harness status: OK
2+
3+
Found 23 tests
4+
5+
23 Pass
6+
Pass e.style['width'] = "random()" should not set the property value
7+
Pass e.style['width'] = "random( )" should not set the property value
8+
Pass e.style['width'] = "random(,)" should not set the property value
9+
Pass e.style['width'] = "random(1px, )" should not set the property value
10+
Pass e.style['width'] = "random(,1px)" should not set the property value
11+
Pass e.style['width'] = "random(1px)" should not set the property value
12+
Pass e.style['width'] = "random(1px,2px,)" should not set the property value
13+
Pass e.style['width'] = "random(1px,2px,1px,)" should not set the property value
14+
Pass e.style['width'] = "random(1px,2px,1px foo)" should not set the property value
15+
Pass e.style['width'] = "random(foo, 1px, 2px)" should not set the property value
16+
Pass e.style['width'] = "random(\"foo\", 1px, 2px)" should not set the property value
17+
Pass e.style['width'] = "random(\"--foo\", 1px, 2px)" should not set the property value
18+
Pass e.style['width'] = "random(element-shared foo, 1px, 2px)" should not set the property value
19+
Pass e.style['width'] = "random(element-shared 1px, 2px)" should not set the property value
20+
Pass e.style['width'] = "random(1px, 2px, 1px, element-shared)" should not set the property value
21+
Pass e.style['width'] = "random(--foo --bar, 1px, 2px)" should not set the property value
22+
Pass e.style['width'] = "random(fixed 0.5 element-shared, 1px, 2px)" should not set the property value
23+
Pass e.style['width'] = "random(fixed 0.5 auto, 1px, 2px)" should not set the property value
24+
Pass e.style['width'] = "random(fixed 0.5 --foo, 1px, 2px)" should not set the property value
25+
Pass e.style['width'] = "random(fixed 0.5px, 1px, 2px)" should not set the property value
26+
Pass e.style['width'] = "random(fixed 0.5%, 1px, 2px)" should not set the property value
27+
Pass e.style['width'] = "random(fixed -1, 1px, 2px)" should not set the property value
28+
Pass e.style['width'] = "random(10deg, 20deg)" should not set the property value
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Harness status: OK
2+
3+
Found 32 tests
4+
5+
32 Fail
6+
Fail e.style['width'] = "random(0px, 100px)" should set the property value
7+
Fail e.style['width'] = "random(0px, 100px, 50px)" should set the property value
8+
Fail e.style['width'] = "random(--foo, 0px, 100px)" should set the property value
9+
Fail e.style['width'] = "random(auto, 0px, 100px)" should set the property value
10+
Fail e.style['width'] = "random(--foo element-shared, 0px, 100px)" should set the property value
11+
Fail e.style['width'] = "random(auto element-shared, 0px, 100px)" should set the property value
12+
Fail e.style['width'] = "random(element-shared --foo, 0px, 100px)" should set the property value
13+
Fail e.style['width'] = "random(element-shared auto, 0px, 100px)" should set the property value
14+
Fail e.style['width'] = "random(fixed 0.5, 0px, 100px)" should set the property value
15+
Fail e.style['width'] = "random(--foo, 0px, 100px, 50px)" should set the property value
16+
Fail e.style['width'] = "random(auto, 0px, 100px, 50px)" should set the property value
17+
Fail e.style['width'] = "random(--foo element-shared, 0px, 100px, 50px)" should set the property value
18+
Fail e.style['width'] = "random(auto element-shared, 0px, 100px, 50px)" should set the property value
19+
Fail e.style['width'] = "random(element-shared --foo, 0px, 100px, 50px)" should set the property value
20+
Fail e.style['width'] = "random(element-shared auto, 0px, 100px, 50px)" should set the property value
21+
Fail e.style['width'] = "random(fixed 0.5, 0px, 100px, 50px)" should set the property value
22+
Fail e.style['width'] = "random(10px, 20%)" should set the property value
23+
Fail e.style['width'] = "random(100px, 0px)" should set the property value
24+
Fail e.style['width'] = "random(-100px, -10px)" should set the property value
25+
Fail e.style['width'] = "random(-100px, -10px, -5px)" should set the property value
26+
Fail e.style['width'] = "random(1em, 200rem)" should set the property value
27+
Fail e.style['width'] = "random(10 * 100px, 200em / 2)" should set the property value
28+
Fail e.style['width'] = "random(fixed calc(2 / 4), 0px, 100px)" should set the property value
29+
Fail e.style['width'] = "calc(2 * random(0px, 100px))" should set the property value
30+
Fail e.style['max-lines'] = "random(25, 50)" should set the property value
31+
Fail e.style['max-lines'] = "random(25, 50, 5)" should set the property value
32+
Fail e.style['scale'] = "random(0.5, 2.5)" should set the property value
33+
Fail e.style['scale'] = "random(0.5, 2.5, 0.1)" should set the property value
34+
Fail e.style['rotate'] = "random(25deg, 1turn)" should set the property value
35+
Fail e.style['rotate'] = "random(25deg, 1turn, 5deg)" should set the property value
36+
Fail e.style['transition-delay'] = "random(25ms, 50s)" should set the property value
37+
Fail e.style['transition-delay'] = "random(25ms, 50s, 5s)" should set the property value

0 commit comments

Comments
 (0)