Skip to content

Commit 4c97b33

Browse files
Calme1709AtkinsSJ
authored andcommitted
Tests: Import timing function tests
1 parent 41b4292 commit 4c97b33

File tree

8 files changed

+269
-0
lines changed

8 files changed

+269
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Harness status: OK
2+
3+
Found 35 tests
4+
5+
12 Pass
6+
23 Fail
7+
Pass e.style['animation-timing-function'] = "linear(0 0%, 1 100%)" should set the property value
8+
Pass e.style['animation-timing-function'] = "linear( 0 0%, 1 100% )" should set the property value
9+
Fail e.style['animation-timing-function'] = "linear(0, 1)" should set the property value
10+
Pass e.style['animation-timing-function'] = "linear(-10, -5, 0, 5, 10)" should set the property value
11+
Fail e.style['animation-timing-function'] = "linear(-10 -10%, -5 -5%, 0, 5, 10)" should set the property value
12+
Fail e.style['animation-timing-function'] = "linear(0 calc(0%), 0 calc(100%))" should set the property value
13+
Fail e.style['animation-timing-function'] = "linear(0 calc(50% - 50%), 0 calc(50% + 50%))" should set the property value
14+
Fail e.style['animation-timing-function'] = "linear(0 calc(50%), 0 100%)" should set the property value
15+
Fail e.style['animation-timing-function'] = "linear(0 0% 50%, 1 50% 100%)" should set the property value
16+
Fail e.style['animation-timing-function'] = "linear(0, 0.5 25% 75%, 1 100% 100%)" should set the property value
17+
Fail e.style['animation-timing-function'] = "linear(0, 1.3, 1, 0.92, 1, 0.99, 1, 0.998, 1 100% 100%)" should set the property value
18+
Pass e.style['animation-timing-function'] = "linear(0, 0 40%, 1, 0.5, 1)" should set the property value
19+
Fail e.style['animation-timing-function'] = "linear(0, 1.3, 1, 0.92, 1, 0.99, 1, 1.004, 0.998, 1 100% 100%)" should set the property value
20+
Fail e.style['animation-timing-function'] = "linear(calc(0/0), 1)" should set the property value
21+
Pass e.style['animation-timing-function'] = "linear()" should not set the property value
22+
Fail e.style['animation-timing-function'] = "linear(0)" should not set the property value
23+
Pass e.style['animation-timing-function'] = "linear(100%)" should not set the property value
24+
Pass e.style['animation-timing-function'] = "linear(0% 1 50%)" should not set the property value
25+
Fail e.style['animation-timing-function'] = "linear(0 0% 100%)" should not set the property value
26+
Fail e.style['animation-timing-function'] = "linear(0% 100% 0)" should not set the property value
27+
Pass e.style['animation-timing-function'] = "linear(0 calc(50px - 50%), 0 calc(50em + 50em))" should not set the property value
28+
Pass e.style['animation-timing-function'] = "linear(0 calc(50%, 50%), 0 calc(50% + 50%))" should not set the property value
29+
Pass Property animation-timing-function value 'linear(0 0%, 1 100%)'
30+
Pass Property animation-timing-function value 'linear( 0 0%, 1 100% )'
31+
Fail Property animation-timing-function value 'linear(0, 1)'
32+
Fail Property animation-timing-function value 'linear(-10, -5, 0, 5, 10)'
33+
Fail Property animation-timing-function value 'linear(-10 -10%, -5 -5%, 0, 5, 10)'
34+
Fail Property animation-timing-function value 'linear(0 calc(0%), 0 calc(100%))'
35+
Fail Property animation-timing-function value 'linear(0 calc(50% - 50%), 0 calc(50% + 50%))'
36+
Fail Property animation-timing-function value 'linear(0 calc(min(50%, 60%)), 0 100%)'
37+
Pass Property animation-timing-function value 'linear(0 0% 50%, 1 50% 100%)'
38+
Fail Property animation-timing-function value 'linear(0, 0.5 25% 75%, 1 100% 100%)'
39+
Fail Property animation-timing-function value 'linear(0, 1.3, 1, 0.92, 1, 0.99, 1, 0.998, 1 100% 100%)'
40+
Fail Property animation-timing-function value 'linear(0, 0 40%, 1, 0.5, 1)'
41+
Fail Property animation-timing-function value 'linear(0, 1.3, 1, 0.92, 1, 0.99, 1, 1.004, 0.998, 1 100% 100%)'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Harness status: OK
2+
3+
Found 15 tests
4+
5+
14 Pass
6+
1 Fail
7+
Pass e.style['animation-timing-function'] = "step-start" should set the property value
8+
Pass e.style['animation-timing-function'] = "step-end" should set the property value
9+
Pass e.style['animation-timing-function'] = "steps(1, start)" should set the property value
10+
Pass e.style['animation-timing-function'] = "steps(1, end)" should set the property value
11+
Pass e.style['animation-timing-function'] = "steps(1, jump-start)" should set the property value
12+
Pass e.style['animation-timing-function'] = "steps(1, jump-end)" should set the property value
13+
Pass e.style['animation-timing-function'] = "steps(1, jump-both)" should set the property value
14+
Pass e.style['animation-timing-function'] = "steps(2, jump-none)" should set the property value
15+
Pass e.style['animation-timing-function'] = "steps(0, start)" should not set the property value
16+
Pass e.style['animation-timing-function'] = "steps(0, end)" should not set the property value
17+
Pass e.style['animation-timing-function'] = "steps(0, jump-start)" should not set the property value
18+
Pass e.style['animation-timing-function'] = "steps(0, jump-end)" should not set the property value
19+
Pass e.style['animation-timing-function'] = "steps(0, jump-both)" should not set the property value
20+
Pass e.style['animation-timing-function'] = "steps(1, jump-none)" should not set the property value
21+
Fail e.style['animation-timing-function'] = "steps(calc(0/0), jump-none)" should not set the property value
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Harness status: OK
2+
3+
Found 13 tests
4+
5+
13 Pass
6+
Pass e.style['animation-timing-function'] = "auto" should not set the property value
7+
Pass e.style['animation-timing-function'] = "ease-in ease-out" should not set the property value
8+
Pass e.style['animation-timing-function'] = "cubic-bezier(1, 2, 3)" should not set the property value
9+
Pass e.style['animation-timing-function'] = "cubic-bezier(1, 2, 3, infinite)" should not set the property value
10+
Pass e.style['animation-timing-function'] = "cubic-bezier(1, 2, 3, 4, 5)" should not set the property value
11+
Pass e.style['animation-timing-function'] = "cubic-bezier(-0.1, 0.1, 0.5, 0.9)" should not set the property value
12+
Pass e.style['animation-timing-function'] = "cubic-bezier(0.5, 0.1, 1.1, 0.9)" should not set the property value
13+
Pass e.style['animation-timing-function'] = "initial, cubic-bezier(0, -2, 1, 3)" should not set the property value
14+
Pass e.style['animation-timing-function'] = "cubic-bezier(0, -2, 1, 3), initial" should not set the property value
15+
Pass e.style['animation-timing-function'] = "steps(1, jump-none)" should not set the property value
16+
Pass e.style['animation-timing-function'] = "steps(-100, jump-none)" should not set the property value
17+
Pass e.style['animation-timing-function'] = "steps(0, start)" should not set the property value
18+
Pass e.style['animation-timing-function'] = "steps(-100, start)" should not set the property value
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 22 tests
4+
5+
20 Pass
6+
2 Fail
7+
Pass Property transition-timing-function value 'linear'
8+
Pass Property transition-timing-function value 'ease'
9+
Pass Property transition-timing-function value 'ease-in'
10+
Pass Property transition-timing-function value 'ease-out'
11+
Pass Property transition-timing-function value 'ease-in-out'
12+
Pass Property transition-timing-function value 'cubic-bezier(0.1, 0.2, 0.8, 0.9)'
13+
Pass Property transition-timing-function value 'cubic-bezier(0, -2, 1, 3)'
14+
Pass Property transition-timing-function value 'cubic-bezier(0, 0.7, 1, 1.3)'
15+
Pass Property transition-timing-function value 'step-start'
16+
Pass Property transition-timing-function value 'step-end'
17+
Pass Property transition-timing-function value 'steps(4)'
18+
Pass Property transition-timing-function value 'steps(4, start)'
19+
Pass Property transition-timing-function value 'steps(2, end)'
20+
Pass Property transition-timing-function value 'steps(2, jump-start)'
21+
Pass Property transition-timing-function value 'steps(2, jump-end)'
22+
Pass Property transition-timing-function value 'steps(2, jump-both)'
23+
Pass Property transition-timing-function value 'steps(2, jump-none)'
24+
Fail Property transition-timing-function value 'steps(calc(2 * sibling-index()), jump-none)'
25+
Fail Property transition-timing-function value 'steps(sibling-index(), jump-none)'
26+
Pass Property transition-timing-function value 'steps(calc(2 * sign(1em - 1000px)), jump-none)'
27+
Pass Property transition-timing-function value 'steps(calc(2 * sign(1em - 1000px)), start)'
28+
Pass Property transition-timing-function value 'linear, ease, linear'
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>CSS Easing: getComputedStyle().animationTimingFunction with linear(...)</title>
6+
<link rel="help" href="https://drafts.csswg.org/css-easing-2/#the-linear-easing-function">
7+
<meta name="assert" content="animation-timing-function: linear(...) parsing tests">
8+
<script src="../../resources/testharness.js"></script>
9+
<script src="../../resources/testharnessreport.js"></script>
10+
<script src="../../css/support/computed-testcommon.js"></script>
11+
<script src="../../css/support/parsing-testcommon.js"></script>
12+
</head>
13+
<body>
14+
<div id="target"></div>
15+
<script>
16+
test_valid_value("animation-timing-function", "linear(0 0%, 1 100%)");
17+
test_valid_value("animation-timing-function", "linear( 0 0%, 1 100% )", "linear(0 0%, 1 100%)");
18+
test_valid_value("animation-timing-function", "linear(0, 1)");
19+
test_valid_value("animation-timing-function", "linear(-10, -5, 0, 5, 10)");
20+
test_valid_value("animation-timing-function", "linear(-10 -10%, -5 -5%, 0, 5, 10)");
21+
test_valid_value("animation-timing-function", "linear(0 calc(0%), 0 calc(100%))");
22+
test_valid_value("animation-timing-function", "linear(0 calc(50% - 50%), 0 calc(50% + 50%))", "linear(0 calc(0%), 0 calc(100%))");
23+
test_valid_value("animation-timing-function", "linear(0 calc(50%), 0 100%)");
24+
test_valid_value("animation-timing-function", "linear(0 0% 50%, 1 50% 100%)");
25+
test_valid_value("animation-timing-function", "linear(0, 0.5 25% 75%, 1 100% 100%)");
26+
test_valid_value("animation-timing-function", "linear(0, 1.3, 1, 0.92, 1, 0.99, 1, 0.998, 1 100% 100%)");
27+
test_valid_value("animation-timing-function", "linear(0, 0 40%, 1, 0.5, 1)");
28+
test_valid_value("animation-timing-function", "linear(0, 1.3, 1, 0.92, 1, 0.99, 1, 1.004, 0.998, 1 100% 100%)");
29+
test_valid_value("animation-timing-function", "linear(calc(0/0), 1)", "linear(0 0%, 1 100%)");
30+
31+
test_invalid_value("animation-timing-function", "linear()");
32+
test_invalid_value("animation-timing-function", "linear(0)");
33+
test_invalid_value("animation-timing-function", "linear(100%)");
34+
test_invalid_value("animation-timing-function", "linear(0% 1 50%)");
35+
test_invalid_value("animation-timing-function", "linear(0 0% 100%)");
36+
test_invalid_value("animation-timing-function", "linear(0% 100% 0)");
37+
test_invalid_value("animation-timing-function", "linear(0 calc(50px - 50%), 0 calc(50em + 50em))");
38+
test_invalid_value("animation-timing-function", "linear(0 calc(50%, 50%), 0 calc(50% + 50%))");
39+
40+
test_computed_value("animation-timing-function", "linear(0 0%, 1 100%)");
41+
test_computed_value("animation-timing-function", "linear( 0 0%, 1 100% )", "linear(0 0%, 1 100%)");
42+
test_computed_value("animation-timing-function", "linear(0, 1)", "linear(0 0%, 1 100%)");
43+
test_computed_value("animation-timing-function", "linear(-10, -5, 0, 5, 10)", "linear(-10 0%, -5 25%, 0 50%, 5 75%, 10 100%)");
44+
test_computed_value("animation-timing-function", "linear(-10 -10%, -5 -5%, 0, 5, 10)", "linear(-10 -10%, -5 -5%, 0 30%, 5 65%, 10 100%)");
45+
test_computed_value("animation-timing-function", "linear(0 calc(0%), 0 calc(100%))", "linear(0 0%, 0 100%)");
46+
test_computed_value("animation-timing-function", "linear(0 calc(50% - 50%), 0 calc(50% + 50%))", "linear(0 0%, 0 100%)");
47+
test_computed_value("animation-timing-function", "linear(0 calc(min(50%, 60%)), 0 100%)", "linear(0 50%, 0 100%)");
48+
test_computed_value("animation-timing-function", "linear(0 0% 50%, 1 50% 100%)", "linear(0 0%, 0 50%, 1 50%, 1 100%)");
49+
test_computed_value("animation-timing-function", "linear(0, 0.5 25% 75%, 1 100% 100%)", "linear(0 0%, 0.5 25%, 0.5 75%, 1 100%, 1 100%)");
50+
test_computed_value("animation-timing-function", "linear(0, 1.3, 1, 0.92, 1, 0.99, 1, 0.998, 1 100% 100%)", "linear(0 0%, 1.3 12.5%, 1 25%, 0.92 37.5%, 1 50%, 0.99 62.5%, 1 75%, 0.998 87.5%, 1 100%, 1 100%)");
51+
test_computed_value("animation-timing-function", "linear(0, 0 40%, 1, 0.5, 1)", "linear(0 0%, 0 40%, 1 60%, 0.5 80%, 1 100%)");
52+
test_computed_value("animation-timing-function", "linear(0, 1.3, 1, 0.92, 1, 0.99, 1, 1.004, 0.998, 1 100% 100%)", "linear(0 0%, 1.3 11.111111%, 1 22.222222%, 0.92 33.333333%, 1 44.444444%, 0.99 55.555556%, 1 66.666667%, 1.004 77.777778%, 0.998 88.888889%, 1 100%, 1 100%)");
53+
</script>
54+
</body>
55+
</html>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<meta charset=utf-8>
3+
<meta name="assert"
4+
content="This test checks the syntax output of step timing functions" />
5+
<title>Step timing function syntax tests</title>
6+
<link rel="help"
7+
href="https://drafts.csswg.org/css-easing-1/#step-timing-functions">
8+
<script src="../../resources/testharness.js"></script>
9+
<script src="../../resources/testharnessreport.js"></script>
10+
<script src="testcommon.js"></script>
11+
<script src="../../css/support/parsing-testcommon.js"></script>
12+
<body>
13+
<div id="log"></div>
14+
<script>
15+
"use strict";
16+
17+
test_valid_value("animation-timing-function", "step-start", "steps(1, start)");
18+
test_valid_value("animation-timing-function", "step-end", "steps(1)");
19+
test_valid_value("animation-timing-function", "steps(1, start)");
20+
test_valid_value("animation-timing-function", "steps(1, end)", "steps(1)");
21+
test_valid_value("animation-timing-function", "steps(1, jump-start)");
22+
test_valid_value("animation-timing-function", "steps(1, jump-end)", "steps(1)");
23+
test_valid_value("animation-timing-function", "steps(1, jump-both)");
24+
test_valid_value("animation-timing-function", "steps(2, jump-none)");
25+
26+
test_invalid_value("animation-timing-function", "steps(0, start)");
27+
test_invalid_value("animation-timing-function", "steps(0, end)");
28+
test_invalid_value("animation-timing-function", "steps(0, jump-start)");
29+
test_invalid_value("animation-timing-function", "steps(0, jump-end)");
30+
test_invalid_value("animation-timing-function", "steps(0, jump-both)");
31+
test_invalid_value("animation-timing-function", "steps(1, jump-none)");
32+
test_invalid_value("animation-timing-function", "steps(calc(0/0), jump-none)");
33+
34+
</script>
35+
</body>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>CSS Easing: parsing animation-timing-function with invalid values</title>
6+
<link rel="help" href="https://drafts.csswg.org/css-easing/#timing-functions">
7+
<meta name="assert" content="animation-timing-function supports only the grammar '<timing-function> #'.">
8+
<script src="../../resources/testharness.js"></script>
9+
<script src="../../resources/testharnessreport.js"></script>
10+
<script src="../../css/support/parsing-testcommon.js"></script>
11+
</head>
12+
<body>
13+
<script>
14+
test_invalid_value("animation-timing-function", "auto");
15+
test_invalid_value("animation-timing-function", "ease-in ease-out");
16+
test_invalid_value("animation-timing-function", "cubic-bezier(1, 2, 3)");
17+
test_invalid_value("animation-timing-function", "cubic-bezier(1, 2, 3, infinite)");
18+
test_invalid_value("animation-timing-function", "cubic-bezier(1, 2, 3, 4, 5)");
19+
test_invalid_value("animation-timing-function", "cubic-bezier(-0.1, 0.1, 0.5, 0.9)");
20+
test_invalid_value("animation-timing-function", "cubic-bezier(0.5, 0.1, 1.1, 0.9)");
21+
test_invalid_value("animation-timing-function", "initial, cubic-bezier(0, -2, 1, 3)");
22+
test_invalid_value("animation-timing-function", "cubic-bezier(0, -2, 1, 3), initial");
23+
test_invalid_value("animation-timing-function", "steps(1, jump-none)");
24+
test_invalid_value("animation-timing-function", "steps(-100, jump-none)");
25+
test_invalid_value("animation-timing-function", "steps(0, start)");
26+
test_invalid_value("animation-timing-function", "steps(-100, start)");
27+
</script>
28+
</body>
29+
</html>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>CSS Animations: getComputedStyle().transitionTimingFunction</title>
6+
<link rel="help" href="https://drafts.csswg.org/css-transitions/#propdef-transition-timing-function">
7+
<meta name="assert" content="transition-timing-function computed value is a computed <easing-function> list.">
8+
<script src="../../../resources/testharness.js"></script>
9+
<script src="../../../resources/testharnessreport.js"></script>
10+
<script src="../../../css/support/computed-testcommon.js"></script>
11+
</head>
12+
<body>
13+
<div id="target" style="font-size: 16px;"></div>
14+
<script>
15+
test_computed_value("transition-timing-function", "linear");
16+
17+
test_computed_value("transition-timing-function", "ease");
18+
test_computed_value("transition-timing-function", "ease-in");
19+
test_computed_value("transition-timing-function", "ease-out");
20+
test_computed_value("transition-timing-function", "ease-in-out");
21+
test_computed_value("transition-timing-function", "cubic-bezier(0.1, 0.2, 0.8, 0.9)");
22+
test_computed_value("transition-timing-function", "cubic-bezier(0, -2, 1, 3)");
23+
test_computed_value("transition-timing-function", "cubic-bezier(0, 0.7, 1, 1.3)");
24+
25+
test_computed_value("transition-timing-function", "step-start", "steps(1, start)");
26+
test_computed_value("transition-timing-function", "step-end", "steps(1)");
27+
test_computed_value("transition-timing-function", "steps(4)");
28+
test_computed_value("transition-timing-function", "steps(4, start)");
29+
test_computed_value("transition-timing-function", "steps(2, end)", "steps(2)");
30+
test_computed_value("transition-timing-function", "steps(2, jump-start)");
31+
test_computed_value("transition-timing-function", "steps(2, jump-end)", "steps(2)");
32+
test_computed_value("transition-timing-function", "steps(2, jump-both)");
33+
test_computed_value("transition-timing-function", "steps(2, jump-none)");
34+
test_computed_value("transition-timing-function", "steps(calc(2 * sibling-index()), jump-none)", "steps(2, jump-none)");
35+
test_computed_value("transition-timing-function", "steps(sibling-index(), jump-none)", "steps(2, jump-none)");
36+
test_computed_value("transition-timing-function", "steps(calc(2 * sign(1em - 1000px)), jump-none)", "steps(2, jump-none)");
37+
test_computed_value("transition-timing-function", "steps(calc(2 * sign(1em - 1000px)), start)", "steps(1, start)");
38+
39+
test_computed_value("transition-timing-function", "linear, ease, linear");
40+
</script>
41+
</body>
42+
</html>

0 commit comments

Comments
 (0)