| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset="utf-8"> | 2 <meta charset="utf-8"> |
| 3 <title>Re-initializing events while dispatching them</title> | 3 <title>Re-initializing events while dispatching them</title> |
| 4 <link rel="author" title="Josh Matthews" href="mailto:josh@joshmatthews.net"> | 4 <link rel="author" title="Josh Matthews" href="mailto:josh@joshmatthews.net"> |
| 5 <script src="../../../../resources/testharness.js"></script> | 5 <script src="/resources/testharness.js"></script> |
| 6 <script src="../../../../resources/testharnessreport.js"></script> | 6 <script src="/resources/testharnessreport.js"></script> |
| 7 <div id="log"></div> | 7 <div id="log"></div> |
| 8 <script> | 8 <script> |
| 9 var events = { | 9 var events = { |
| 10 'KeyboardEvent': { | 10 'KeyboardEvent': { |
| 11 'constructor': function() { return new KeyboardEvent("type", {key: "A"}); }, | 11 'constructor': function() { return new KeyboardEvent("type", {key: "A"}); }, |
| 12 'init': function(ev) { ev.initKeyboardEvent("type2", true, true, null, "a",
1, "", true, "") }, | 12 'init': function(ev) { ev.initKeyboardEvent("type2", true, true, null, "a",
1, "", true, "") }, |
| 13 'check': function(ev) { | 13 'check': function(ev) { |
| 14 assert_equals(ev.key, "A", "initKeyboardEvent key setter should short-cir
cuit"); | 14 assert_equals(ev.key, "A", "initKeyboardEvent key setter should short-cir
cuit"); |
| 15 assert_false(ev.repeat, "initKeyboardEvent repeat setter should short-cir
cuit"); | 15 assert_false(ev.repeat, "initKeyboardEvent repeat setter should short-cir
cuit"); |
| 16 assert_equals(ev.location, 0, "initKeyboardEvent location setter should s
hort-circuit"); | 16 assert_equals(ev.location, 0, "initKeyboardEvent location setter should s
hort-circuit"); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 74 } |
| 75 events[o.constructor.name].check(e); | 75 events[o.constructor.name].check(e); |
| 76 } | 76 } |
| 77 }), false); | 77 }), false); |
| 78 | 78 |
| 79 assert_equals(target.dispatchEvent(e), true, "dispatchEvent must return true
") | 79 assert_equals(target.dispatchEvent(e), true, "dispatchEvent must return true
") |
| 80 }); | 80 }); |
| 81 t.done(); | 81 t.done(); |
| 82 } | 82 } |
| 83 </script> | 83 </script> |
| OLD | NEW |