4 <title>Test to ensure SVG is enabled in Dashboard compatibility mode
</title>
10 url
= 'resources/svgtest.svg';
15 if (window
.XMLHttpRequest
) {
16 rq
= new XMLHttpRequest();
17 rq
.overrideMimeType('text/svg+xml');
18 rq
.onreadystatechange
= processReqChange
;
19 rq
.open('GET', url
, true);
29 var c
= document
.getElementById('console')
30 c
.appendChild(document
.createTextNode(str
+ '\n'));
33 function processReqChange()
35 if (rq
.readyState
== 4) {
37 var svgDoc
= rq
.responseXML
;
38 if (rq
.status
== 200) {
39 debug("Received doc of type: " + svgDoc
);
40 // Import SVG element into tree.
41 var importedNode
= null;
43 importedNode
= document
.importNode(svgDoc
.getElementById('svgCircle'), true);
48 debug("PASS: Managed to insert SVG element into tree");
49 debug("Imported node of type: " + importedNode
);
50 document
.getElementById('targetDiv').appendChild(importedNode
);
52 debug("FAIL: Could not insert SVG element into tree");
55 debug('FAIL: Unable to load SVG document: ' + rq
.statusText
);
59 if (window
.testRunner
)
60 testRunner
.notifyDone();
66 <body onload=
"loadSVG()">
67 <p>Test to make sure we can use XHR to create usable SVG in dashboard compatibility mode. This cannot be tested manually.
</p>
68 <div id=
"targetDiv"></div>
69 <pre id=
"console"></pre>
71 if (window
.testRunner
) {
72 testRunner
.setUseDashboardCompatibilityMode(true);
73 testRunner
.dumpAsText();
74 testRunner
.waitUntilDone();