OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script> |
| 5 var events = []; |
| 6 function logLoadEvent(event) { |
| 7 events.push(event.target.id); |
| 8 } |
| 9 function removeSelfAndLogLoadEvent(event) { |
| 10 logLoadEvent(event); |
| 11 event.target.remove(); |
| 12 } |
| 13 |
| 14 var t = async_test("'load' event fires on parent of element removed in onload ha
ndler."); |
| 15 |
| 16 window.onload = function() { |
| 17 t.step(function() { |
| 18 assert_equals(events.length, 4); |
| 19 assert_equals(events[0], "inner1"); |
| 20 assert_equals(events[1], "image"); |
| 21 assert_equals(events[2], "inner2"); |
| 22 assert_equals(events[3], "outer"); |
| 23 }, 'Verify order and presence of events'); |
| 24 t.done(); |
| 25 }; |
| 26 </script> |
| 27 <svg id="outer" onload="logLoadEvent(evt)"> |
| 28 <svg id="inner1" onload="logLoadEvent(evt)"></svg> |
| 29 <svg id="inner2" onload="logLoadEvent(evt)"> |
| 30 <image id="image" onload="removeSelfAndLogLoadEvent(evt)" |
| 31 xlink:href="resources/red-checker.png" width="10" height="10"/> |
| 32 </svg> |
| 33 </svg> |
OLD | NEW |