[Web Animations] Turn Web Animations with CSS integration on for test runners
[WebKit-https.git] / LayoutTests / animations / cross-fade-background-image.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4   <style>
5     #box {
6         position: absolute;
7         left: 100px;
8         top: 200px;
9         height: 100px;
10         width: 100px;
11         background-color: red;
12         -webkit-animation: anim 1s linear infinite;
13     }
14     #boxShorthand {
15         position: absolute;
16         left: 100px;
17         top: 300px;
18         height: 100px;
19         width: 100px;
20         background-color: red;
21         -webkit-animation: animShorthand 1s linear infinite;
22     }
23     #boxStatic {
24         position: absolute;
25         left: 100px;
26         top: 400px;
27         height: 100px;
28         width: 100px;
29         background-color: red;
30         background-image: -webkit-cross-fade(url(resources/blue-100.png), url(resources/green-100.png), 50%);
31     }
32     #boxAnim1 {
33         position: absolute;
34         left: 200px;
35         top: 200px;
36         height: 100px;
37         width: 100px;
38         background-color: red;
39         -webkit-animation: animCross1 1s linear infinite;
40     }
41     #boxAnim2 {
42         position: absolute;
43         left: 200px;
44         top: 300px;
45         height: 100px;
46         width: 100px;
47         background-color: red;
48         -webkit-animation: animCross2 1s linear infinite;
49     }
50     #boxAnim3 {
51         position: absolute;
52         left: 200px;
53         top: 400px;
54         height: 100px;
55         width: 100px;
56         background-color: red;
57         -webkit-animation: animCross3 1s linear infinite;
58     }
59     @-webkit-keyframes anim {
60         from { background-image: url(resources/blue-100.png); }
61         to   { background-image: url(resources/green-100.png); }
62     }
63     @-webkit-keyframes animShorthand {
64         from { background: url(resources/blue-100.png); }
65         to   { background: url(resources/green-100.png); }
66     }
67     @-webkit-keyframes animCross1 {
68         from { background-image: -webkit-cross-fade(url(resources/blue-100.png), url(resources/green-100.png), 20%); }
69         to   { background-image: -webkit-cross-fade(url(resources/blue-100.png), url(resources/green-100.png), 0.8); }
70     }
71     @-webkit-keyframes animCross2 {
72         /* Image inputs are not identical - no animation.*/
73         from { background-image: -webkit-cross-fade(url(resources/blue-100.png), url(resources/green-100.png), 20%); }
74         to   { background-image: cross-fade(url(resources/green-100.png), url(resources/blue-100.png), 50%); }
75     }
76     @-webkit-keyframes animCross3 {
77         /* Direct image inputs are not identical - no animation.*/
78         from { background-image: -webkit-cross-fade(-webkit-filter(url(resources/blue-100.png), contrast(0.5)), url(resources/green-100.png), 20%); }
79         to   { background-image: -webkit-cross-fade(url(resources/blue-100.png), url(resources/green-100.png), 50%); }
80     }
81   </style>
82   <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
83   <script type="text/javascript" charset="utf-8">
84     const expectedValues = [
85       // [animation-name, time, element-id, property, expected-value, tolerance]
86       ["anim", 2.5, "box", "backgroundImage", "cross-fade(url(blue-100.png), url(green-100.png), 50%)", 0.05],
87       ["anim", 2.5, ["box", "static:boxStatic"], "backgroundImage", "cross-fade(url(blue-100.png), url(green-100.png), 50%)", 0.05],
88       ["animShorthand", 2.5, ["boxShorthand", "static:boxStatic"], "backgroundImage", "cross-fade(url(blue-100.png), url(green-100.png), 50%)", 0.05],
89       ["animCross1", 2.5, "boxAnim1", "backgroundImage", "cross-fade(url(resources/blue-100.png), url(resources/green-100.png), 0.5)", 0.05],
90       ["animCross2", 2.5, "boxAnim2", "backgroundImage", "cross-fade(url(resources/green-100.png), url(resources/blue-100.png), 50%)", 0],
91       ["animCross3", 2.5, "boxAnim3", "backgroundImage", "cross-fade(url(resources/blue-100.png), url(resources/green-100.png), 50%)", 0],
92     ];
93
94     var doPixelTest = true;
95     var disablePauseAPI = false;
96     runAnimationTest(expectedValues, null, undefined, disablePauseAPI, doPixelTest);
97   </script>
98 </head>
99 <body>
100 <div id="box"></div>
101 <div id="boxStatic"></div>
102 <div id="boxShorthand"></div>
103 <div id="boxAnim1"></div>
104 <div id="boxAnim2"></div>
105 <div id="boxAnim3"></div>
106 <div id="result"></div>
107 </body>
108 </html>