summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/motion/animation/offset-path-interpolation-007.html
blob: 6629f285d1855d7a0e3aba3241ffd0f8da818c42 (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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>offset-path interpolation with allow-discrete</title>
    <link rel="help" href="https://drafts.fxtf.org/motion-1/#offset-path-property">
    <meta name="assert" content="offset-path supports animation with allow-discrete.">
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <script src="/css/support/interpolation-testcommon.js"></script>
  </head>
  <style>
    .parent {
      offset-path: circle(farthest-side);
    }
    .target {
      offset-path: circle(10px);
    }
  </style>
  <body>
    <script>
      'use strict';

      test_interpolation({
        property: 'offset-path',
        behavior: 'allow-discrete',
        from: 'circle(10px)',
        to: 'inset(20px)',
      }, [
        {at: -1, expect: 'circle(10px)'},
        {at: 0, expect: 'circle(10px)'},
        {at: 0.4, expect: 'circle(10px)'},
        {at: 0.5, expect: 'inset(20px)'},
        {at: 1, expect: 'inset(20px)'},
        {at: 1.5, expect: 'inset(20px)'},
      ]);

      test_interpolation({
        property: 'offset-path',
        behavior: 'allow-discrete',
        from: 'ellipse(at center)',
        to: 'none',
      }, [
        {at: -1, expect: 'ellipse(at center)'},
        {at: 0, expect: 'ellipse(at center)'},
        {at: 0.4, expect: 'ellipse(at center)'},
        {at: 0.5, expect: 'none'},
        {at: 1, expect: 'none'},
        {at: 1.5, expect: 'none'},
      ]);

      test_interpolation({
        property: 'offset-path',
        behavior: 'allow-discrete',
        from: neutralKeyframe,
        to: 'none',
      }, [
        {at: -1, expect: 'circle(10px)'},
        {at: 0, expect: 'circle(10px)'},
        {at: 0.4, expect: 'circle(10px)'},
        {at: 0.5, expect: 'none'},
        {at: 1, expect: 'none'},
        {at: 1.5, expect: 'none'},
      ]);

      test_interpolation({
        property: 'offset-path',
        behavior: 'allow-discrete',
        from: 'initial',
        to: 'circle()',
      }, [
        {at: -1, expect: 'none'},
        {at: 0, expect: 'none'},
        {at: 0.4, expect: 'none'},
        {at: 0.5, expect: 'circle()'},
        {at: 1, expect: 'circle()'},
        {at: 1.5, expect: 'circle()'},
      ]);

      test_interpolation({
        property: 'offset-path',
        behavior: 'allow-discrete',
        from: 'inherit',
        to: 'circle()',
      }, [
        {at: -0.1, expect: 'circle(farthest-side)'},
        {at: 0, expect: 'circle(farthest-side)'},
        {at: 0.4, expect: 'circle(farthest-side)'},
        {at: 0.5, expect: 'circle()'},
        {at: 1, expect: 'circle()'},
        {at: 1.5, expect: 'circle()'},
      ]);

      test_interpolation({
        property: 'offset-path',
        behavior: 'allow-discrete',
        from: 'unset',
        to: 'inset(10%)',
      }, [
        {at: -0.1, expect: 'none'},
        {at: 0, expect: 'none'},
        {at: 0.4, expect: 'none'},
        {at: 0.5, expect: 'inset(10%)'},
        {at: 1, expect: 'inset(10%)'},
        {at: 1.5, expect: 'inset(10%)'},
      ]);

      test_interpolation({
        property: 'offset-path',
        behavior: 'allow-discrete',
        from: 'ray(0deg)',
        to: 'url("abc")',
      }, [
        {at: -0.1, expect: 'ray(0deg)'},
        {at: 0, expect: 'ray(0deg)'},
        {at: 0.4, expect: 'ray(0deg)'},
        {at: 0.5, expect: 'url("abc")'},
        {at: 1, expect: 'url("abc")'},
        {at: 1.5, expect: 'url("abc")'},
      ]);

    </script>
  </body>
</html>