Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / xmlhttprequest-image-not-loaded.html
blobc3b29e81e818f395d9f8734a844949e5f774cdee
1 <html>
2 <head>
3 <title>Safari Issue: Not Rendering Images Imported from XHTML Document</title>
4 </head>
5 <body>
6 <p> Test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=17897"> bug 17897 </a>: Not Rendering Images Imported from XHTML Document </p>
7 <p> You should see PASSED once. </p>
8 <div id='console'>FAILED (did not load the image)</div>
9 <div id='image' style="display: none"> </div>
10 <script type="text/javascript">
12 function logSuccessOrFailure()
14 var console = document.getElementById('console');
15 // If the image was loaded correctly, then height
16 // and width are not zero.
17 if (icon.height && icon.width)
18 console.innerHTML = "PASSED";
19 else
20 console.innerHTML = "FAILED";
22 if (window.testRunner)
23 testRunner.notifyDone();
26 if (window.testRunner) {
27 testRunner.dumpAsText();
28 testRunner.waitUntilDone();
31 var xhr = new XMLHttpRequest();
32 xhr.open('GET', 'resources/load-icon.xhtml');
33 xhr.onreadystatechange = function(){
34 if(xhr.readyState == 4 && xhr.status == 200) {
35 var div = xhr.responseXML.getElementsByTagName('div')[0];
36 try {
37 document.adoptNode(div);
39 catch(e){}
41 var icon = div.getElementsByTagName('img')[0];
42 icon.addEventListener("load", logSuccessOrFailure, true);
44 document.getElementById('image').appendChild(div);
47 xhr.send(null);
48 </script>
49 </body>
50 </html>