1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE svg PUBLIC
"-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/SVG/DTD/svg10.dtd">
3 <svg width=
"100%" height=
"100%" xmlns=
"http://www.w3.org/2000/svg" xmlns:
xlink=
"http://www.w3.org/1999/xlink">
4 <text x=
"0" y=
"20"> Test case for
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=17897"> bug
17897 </a>: Not Rendering Images Imported from XHTML Document
</text>
5 <text y=
"40"> You should see PASSED once.
</text>
6 <g style=
"visibility:hidden" id='image'
y=
"60" width=
"250" height=
"50"> </g>
7 <text y=
"80" id=
"console"/>
8 <script type=
"text/ecmascript"> <![CDATA[
9 var xhr = new XMLHttpRequest();
11 function logSuccessOrFailure()
13 var console = document.getElementById('console');
14 // If the image was loaded correctly, then height
15 // and width are not zero.
16 if (icon.height && icon.width)
17 console.appendChild(document.createTextNode(
"PASSED"));
19 console.appendChild(document.createTextNode(
"FAILED"));
21 if (window.testRunner)
22 testRunner.notifyDone();
25 if (window.testRunner) {
26 testRunner.dumpAsText();
27 testRunner.waitUntilDone();
30 xhr.open('GET', 'resources/load-icon.svg');
31 xhr.onreadystatechange = function()
33 if (xhr.readyState ==
4) {
34 var g = xhr.responseXML.getElementsByTagName('g')[
0];
36 document.adoptNode(g);
40 icon = g.getElementsByTagName('image')[
0];
41 logSuccessOrFailure();
43 document.getElementById('image').appendChild(g);