OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Test that when images are moved to a new document, a new load fires.</tit
le> |
3 <head> | 3 <script src="../../resources/testharness.js"></script> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
5 </head> | |
6 <body> | 5 <body> |
7 <script src="script-tests/move-image-to-new-document.js"></script> | 6 <script type="text/javascript"> |
8 </body> | 7 if (window.testRunner) |
9 </html> | 8 testRunner.setPluginsEnabled(false); |
| 9 for (var elementType of [ "img", "input", "object", "embed" ]) { |
| 10 async_test(function(t) { |
| 11 var subframe = document.createElement("iframe"); |
| 12 document.body.appendChild(subframe); |
| 13 var subdocument = subframe.contentDocument; |
| 14 var element = document.createElement(elementType); |
| 15 if (elementType == "input") |
| 16 element.type = "image"; |
| 17 element.data = "resources/test-load.jpg"; |
| 18 element.src = "resources/test-load.jpg"; |
| 19 document.body.appendChild(element); |
| 20 element.onload = t.step_func(function() { |
| 21 document.body.removeChild(element); |
| 22 subdocument.body.appendChild(element); |
| 23 element.onload = t.step_func_done(function() { |
| 24 subdocument.body.removeChild(element); |
| 25 }); |
| 26 }); |
| 27 }, document.title + ', ' + elementType); |
| 28 } |
| 29 </script> |
OLD | NEW |