| <!DOCTYPE html> |
| <html> |
| <body> |
| <script src="../../../resources/js-test.js"></script> |
| <script> |
| description("Tests that creating and setting the src of an image element inside an innerHTML actually loads the resource"); |
| jsTestIsAsync = true; |
| |
| var div = document.createElement('div'); |
| var div2 = document.createElement('div'); |
| var attemptedLoadDirect = false; |
| var attemptedLoadIndirect = false; |
| |
| div.innerHTML = '<img src="../resources/abe.png" onload="attemptedLoadDirect = true;">'; |
| div2.innerHTML = '<div><img src="../resources/abe.png" onload="attemptedLoadIndirect = true;"></div>'; |
| document.body.onload = function() { |
| shouldBeTrue('attemptedLoadDirect'); |
| shouldBeTrue('attemptedLoadIndirect'); |
| finishJSTest(); |
| }; |
| </script> |
| </body> |
| </html> |