b6dfa02b0a3597c440faf037dd61e776bf851b09
[WebKit-https.git] / LayoutTests / animations / simultaneous-start-transform.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
3 <html lang="en">
4 <head>
5   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6   <title>Test simultaneous starting of two animations</title>
7   <style type="text/css" media="screen">
8     .box {
9       position: absolute;
10       top: 40px;
11       height: 100px;
12       width: 100px;
13       background-color: blue;
14       -webkit-animation-duration: 10s;
15       -webkit-animation-timing-function: linear;
16       -webkit-animation-name: "anim";
17     }
18     @-webkit-keyframes "anim" {
19         from { -webkit-transform: rotate(0deg); }
20         to   { -webkit-transform: rotate(360deg); }
21     }
22     #box1 {
23         left: 40px;
24         background-color: blue;
25     }
26     #box2 {
27         left: 160px;
28         background-color: red;
29     }
30   </style>
31   <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
32   <script type="text/javascript" charset="utf-8">
33
34     const expectedValues = [
35       // [animation-name, time, element-id, property, expected-value, tolerance]
36       ["anim", 2, "box1", "webkitTransform", [ 0.309017, 0.951057 ], 0.05],
37       ["anim", 2, "box2", "webkitTransform", [ 0.309017, 0.951057 ], 0.05],
38       ["anim", 2, ["box1", "box2"], "webkitTransform", "", 0],
39       ["anim", 5, "box1", "webkitTransform", [ -1, 0 ], 0.05],
40       ["anim", 5, "box2", "webkitTransform", [ -1, 0 ], 0.05],
41       ["anim", 5, ["box1", "box2"], "webkitTransform", "", 0],
42       ["anim", 8, "box1", "webkitTransform", [ 0.309017, -0.951057 ], 0.05],
43       ["anim", 8, "box2", "webkitTransform", [ 0.309017, -0.951057 ], 0.05],
44       ["anim", 8, ["box1", "box2"], "webkitTransform", "", 0],
45     ];
46     
47     runAnimationTest(expectedValues);
48     
49   </script>
50 </head>
51 <body>
52 This test performs an animation of the transform property. It animates over 10 seconds.
53 It takes 3 snapshots and expects each result to be within a specified range.
54 <div id="box1" class="box">
55 </div>
56 <div id="box2" class="box">
57 </div>
58 <div id="result" style="position:absolute; top:150px">
59 </div>
60 </body>
61 </html>