Kill suspendAnimation(), resumeAnimation() and numberOfActiveAnimations() from DRT...
[WebKit-https.git] / LayoutTests / transitions / remove-transition-style.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5   <style>
6     #box {
7       height: 200px;
8       width: 200px;
9       margin: 20px;
10       background-color: blue;
11     }
12     
13     .animated {
14       -webkit-transition: opacity 200ms;
15     }
16   </style>
17   <script>
18     if (window.testRunner) {
19       testRunner.waitUntilDone();
20       testRunner.dumpAsText();
21     }
22
23     function log(s)
24     {
25       var results = document.getElementById('results');
26       results.innerHTML += s + '<br>';
27     }
28
29     function testTransitions()
30     {
31       if (window.testRunner) {
32         var numAnims = internals.numberOfActiveAnimations();
33         if (numAnims == 0)
34           log('No running transitions: PASS');
35         else
36           log('Still ' + numAnims + ' transitions running: FAIL')
37
38         testRunner.notifyDone();
39       }
40     }
41     
42     function removeStyle()
43     {
44       box.className = '';
45       window.setTimeout(testTransitions, 50);
46     }
47
48     function startTransition()
49     {
50       var box = document.getElementById('box');
51       box.className = 'animated';
52       window.setTimeout(function() {
53         box.style.opacity = '0.5';
54         window.setTimeout(removeStyle, 200);
55       }, 0);
56     }
57     
58     window.addEventListener('load', startTransition, false);
59   </script>
60 </head>
61 <body>
62
63 <div id="box"></div>
64
65 <div id="results"></div>
66 </body>
67 </html>