Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / custom / manually-parsed-embedded-svg-allowed-in-dashboard.html
blobd043c523932b17cdcb27fe3fd2ee103c4799a255
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <head>
3 <title>Make sure embedded SVG is turned off in dashboard</title>
4 </head>
5 <script>
6 function debug(str) {
7 var c = document.getElementById('console')
8 c.appendChild(document.createTextNode(str + '\n'));
11 if (window.testRunner) {
12 testRunner.setUseDashboardCompatibilityMode(true);
13 testRunner.dumpAsText();
15 </script>
16 <body>
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>
20 <script>
21 var documentString = '<html xmlns="http://www.w3.org/1999/xhtml">' +
22 '<body>' +
23 '<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400">' +
24 '<circle id="svgCircle" cx="50" cy="50" r="50" fill="red"/></svg>' +
25 '</body></html>';
27 // Use DOMParser interface to create a SVGDocument datastructure from SVG content string
28 var parser = new DOMParser();
29 var xhtmlDocument = parser.parseFromString(documentString, "application/xhtml+xml");
31 debug("Parsing of the document isn't prevented and produces a " + xhtmlDocument);
32 debug("The circle element is of type " + xhtmlDocument.getElementById('svgCircle'));
34 // Import SVG element into tree.
35 var importedNode = null;
36 try {
37 importedNode = document.importNode(xhtmlDocument.firstChild, true);
38 } catch(e) {
41 if (importedNode) {
42 debug("PASS: Managed to insert SVG element into tree");
43 document.getElementById('targetDiv').appendChild(importedNode);
44 } else {
45 debug("FAIL: Could not insert SVG element into tree");
47 </script>
48 </body>
49 </html>