Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / animations / animation-events-unprefixed-04.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4   <title>Tests that custom events with unprefixed animations names are correctly dispatched.</title>
5   <script>
6     if (window.testRunner) {
7         testRunner.dumpAsText();
8         testRunner.waitUntilDone();
9     }
10
11     document.addEventListener('animationstart', function(e) {
12       document.getElementById('result').innerHTML += 'PASS: animationstart event listener has been called.<br>';
13     }, false);
14
15     document.addEventListener('webkitAnimationStart', function(e) {
16       document.getElementById('result').innerHTML += 'FAIL: webkitAnimationStart event listener should not have been called.<br>';
17     }, false);
18
19     document.addEventListener('animationiteration', function(e) {
20       document.getElementById('result').innerHTML += 'PASS: animationiteration event listener has been called.<br>';
21     }, false);
22
23     document.addEventListener('webkitAnimationIteration', function(e) {
24       document.getElementById('result').innerHTML += 'FAIL: webkitAnimationIteration event listener should not have been called.<br>';
25     }, false);
26
27     document.addEventListener('animationend', function(e) {
28       document.getElementById('result').innerHTML += 'PASS: animationend event listener has been called.';
29       if (window.testRunner)
30         testRunner.notifyDone();
31     }, false);
32
33     document.addEventListener('webkitAnimationEnd', function(e) {
34       document.getElementById('result').innerHTML += 'FAIL: webkitAnimationEnd event listener should not have been called.';
35       if (window.testRunner)
36         testRunner.notifyDone();
37     }, false);
38
39   </script>
40 </head>
41 <body>
42 Tests that custom events with unprefixed animations names are correctly dispatched.
43 <pre id="result"></pre>
44 </body>
45 <script>
46   var custom = document.createEvent('CustomEvent');
47   custom.initCustomEvent('animationstart', true, true);
48   document.dispatchEvent(custom);
49   custom = document.createEvent('CustomEvent');
50   custom.initCustomEvent('animationiteration', true, true);
51   document.dispatchEvent(custom);
52   custom = document.createEvent('CustomEvent');
53   custom.initCustomEvent('animationend', true, true);
54   document.dispatchEvent(custom);
55 </script>
56 </html>