3 <title>Safari Issue: Not Rendering Images Imported from XHTML Document
</title>
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";
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];
37 document
.adoptNode(div
);
41 var icon
= div
.getElementsByTagName('img')[0];
42 icon
.addEventListener("load", logSuccessOrFailure
, true);
44 document
.getElementById('image').appendChild(div
);