| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <meta charset=urf-8> | |
| 3 <title>EventTarget#dispatchEvent(): redispatching a native event</title> | |
| 4 <script src="../../../../resources/testharness.js"></script> | |
| 5 <script src="../../../../resources/testharnessreport.js"></script> | |
| 6 <div id=log></div> | |
| 7 <script> | |
| 8 async_test(function() { | |
| 9 var event; | |
| 10 document.addEventListener("DOMContentLoaded", this.step_func(function(e) { | |
| 11 assert_true(e.isTrusted, "Should be trusted when first handled"); | |
| 12 event = e; | |
| 13 }), true); | |
| 14 | |
| 15 window.onload = this.step_func_done(function() { | |
| 16 var received = 0; | |
| 17 var target = document.createElement("span"); | |
| 18 target.addEventListener("DOMContentLoaded", this.step_func(function(e) { | |
| 19 assert_false(e.isTrusted, "Should not be trusted during redispatching"); | |
| 20 ++received; | |
| 21 }), true); | |
| 22 assert_true(event.isTrusted, "Should be trusted before redispatching"); | |
| 23 target.dispatchEvent(event); | |
| 24 assert_false(event.isTrusted, "Should not be trusted after redispatching"); | |
| 25 assert_equals(received, 1); | |
| 26 }); | |
| 27 }); | |
| 28 </script> | |
| OLD | NEW |