1 <html xmlns=
"http://www.w3.org/1999/xhtml">
3 <title>Make sure embedded SVG is turned on in dashboard
</title>
7 var c
= document
.getElementById('console')
8 c
.appendChild(document
.createTextNode(str
+ '\n'));
11 if (window
.testRunner
) {
12 testRunner
.setUseDashboardCompatibilityMode(true);
13 testRunner
.dumpAsText();
17 <p>This test makes sure we can add manually parsed SVG to the document when in dashboard compatibility mode. It can not be tested manually.
</p>
18 <div id=
"targetDiv"></div>
19 <pre id=
"console"></pre>
21 var documentString
= '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">' +
22 '<circle cx="50" cy="50" r="50" fill="red"/></svg>';
24 // Use DOMParser interface to create a SVGDocument datastructure from SVG content string
25 var parser
= new DOMParser();
26 var svgDocument
= parser
.parseFromString(documentString
, "image/svg+xml");
28 debug("Parsing of the document isn't prevented and produces a " + svgDocument
);
30 // Import SVG element into tree.
31 var importedNode
= null;
33 importedNode
= document
.importNode(svgDocument
.firstChild
, true);
38 debug("PASS: Managed to insert SVG element into tree");
39 document
.getElementById('targetDiv').appendChild(importedNode
);
41 debug("FAIL: Could not insert SVG element into tree");