Merge "[Release] Webkit2-efl-123997_0.11.77" into tizen_2.2
[framework/web/webkit-efl.git] / LayoutTests / animations / stop-animation-on-suspend.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5   <title>Test that animations stop on suspend</title>
6   <style type="text/css" media="screen">
7     iframe {
8         border: 1px solid black;
9         padding: 5px;
10         margin: 20px;
11         height: 200px;
12         width: 600px;
13     }
14     
15     .box {
16         height: 100px;
17         width: 100px;
18         margin: 35px;
19         padding: 5px;
20         background-color: green;
21         overflow:hidden;
22         -webkit-animation: move 400ms alternate infinite linear;
23     }
24
25     @-webkit-keyframes move {
26         from { -webkit-transform: translate3d(0px, 0px, 0px); }
27         to   { -webkit-transform: translate3d(400px, 0px, 0px); }
28     }
29   </style>
30   <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
31   <script type="text/javascript" charset="utf-8">
32   
33     const expectedValues = [
34       // [animation-name, time, element-id, property, expected-value, tolerance]
35       ["move", 0.2, "box", "webkitTransform", [1,0,0,1, 100, 0], 30],
36       ["move", 0.2, "iframe.subframe-box", "webkitTransform", [1,0,0,1, 100, 0], 30],
37       ["move", 0.4, "box", "webkitTransform", [1,0,0,1, 200, 0], 30],
38       ["move", 0.4, "iframe.subframe-box", "webkitTransform", [1,0,0,1, 200, 0], 30],
39     ];
40     
41     function suspend()
42     {
43         if (window.internals)
44             internals.suspendAnimations(document);
45     }
46     
47     function resume()
48     {
49         if (window.internals)
50             internals.resumeAnimations(document);
51     }
52     
53     function setTimers()
54     {
55         setTimeout(suspend, 100);
56         setTimeout(resume, 300);
57     }
58
59     runAnimationTest(expectedValues, setTimers, undefined, true);
60     
61   </script>
62 </head>
63 <body>
64     <div class="box" id="box"></div>
65     <!-- The parent document may into compositing mode by the iframe. -->
66     <iframe id="iframe" src="resources/stop-animation-on-suspend-subframe.html"></iframe>
67     <div id="result"></div>
68 </body>
69 </html>