4 <title>Tests that custom events with unprefixed animations names are correctly dispatched.</title>
6 if (window.testRunner) {
7 testRunner.dumpAsText();
8 testRunner.waitUntilDone();
11 document.addEventListener('animationstart', function(e) {
12 document.getElementById('result').innerHTML += 'PASS: animationstart event listener has been called.<br>';
15 document.addEventListener('webkitAnimationStart', function(e) {
16 document.getElementById('result').innerHTML += 'FAIL: webkitAnimationStart event listener should not have been called.<br>';
19 document.addEventListener('animationiteration', function(e) {
20 document.getElementById('result').innerHTML += 'PASS: animationiteration event listener has been called.<br>';
23 document.addEventListener('webkitAnimationIteration', function(e) {
24 document.getElementById('result').innerHTML += 'FAIL: webkitAnimationIteration event listener should not have been called.<br>';
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();
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();
42 Tests that custom events with unprefixed animations names are correctly dispatched.
43 <pre id="result"></pre>
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);