| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 // Ensure that events are handled correctly when an image element is adopted. | 5 // Ensure that events are handled correctly when an image element is adopted. |
| 6 | 6 |
| 7 jsTestIsAsync = true; | 7 jsTestIsAsync = true; |
| 8 | 8 |
| 9 var doc = document.documentElement.appendChild(document.createElement("iframe"))
.contentDocument; | 9 var doc = document.documentElement.appendChild(document.createElement("iframe"))
.contentDocument; |
| 10 var adopting = false; | 10 var adopting = false; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 x.onload = function() { | 28 x.onload = function() { |
| 29 img.src = blobUrl; | 29 img.src = blobUrl; |
| 30 } | 30 } |
| 31 x.onloadend = function() { | 31 x.onloadend = function() { |
| 32 doc.close(); | 32 doc.close(); |
| 33 URL.revokeObjectURL(blobUrl); | 33 URL.revokeObjectURL(blobUrl); |
| 34 adopting = true; | 34 adopting = true; |
| 35 document.adoptNode(img); | 35 document.adoptNode(img); |
| 36 adopting = false; | 36 adopting = false; |
| 37 if (doc.readyState == "complete" && !readyStateChangeEventHandlerTriggeredWh
enComplete) { | 37 if (doc.readyState == "complete" && !readyStateChangeEventHandlerTriggeredWh
enComplete) { |
| 38 // TODO: This can be replaced with testFailed once https://crbug.com/606
651 is fixed. | 38 testFailed("readystatechange event was dispatched but the handler was su
ppressed"); |
| 39 debug("FAIL readystatechange event was dispatched but the handler was su
ppressed"); | |
| 40 finishJSTest(); | |
| 41 } | 39 } |
| 42 } | 40 } |
| 43 x.open("get", "data:text/html,"); | 41 x.open("get", "data:text/html,"); |
| 44 x.send(); | 42 x.send(); |
| 45 </script> | 43 </script> |
| 46 </html> | 44 </html> |
| OLD | NEW |