3 window
.is
= window
.parent
.is
;
4 window
.SimpleTest
= window
.parent
.SimpleTest
;
6 <div id=
"testnodes"><span>hi
</span> there
<!-- mon ami --></div>
8 let t
= document
.getElementById('testnodes');
10 t
.appendChild(document
.createElementNS("http://www.w3.org/2000/svg", "svg:svg"));
11 t
.firstChild
.textContent
= "<foo>";
12 is(t
.innerHTML
, "<svg:svg><foo></svg:svg>");
14 // This test crashes if the style tags are not handled correctly
15 t
.innerHTML
= `<svg version="1.1">
21 <g><circle cx="25.8" cy="9.3" r="1.5"/></g>
24 is(t
.firstChild
.tagName
.toLowerCase(), 'svg');
26 // This test crashes if the script tags are not handled correctly
27 t
.innerHTML
= `<svg version="1.1">
29 throw "badment, should never fire.";
31 <g><circle cx="25.8" cy="9.3" r="1.5"/></g>
33 is(t
.firstChild
.tagName
.toLowerCase(), 'svg');
36 t
.appendChild(document
.createElementNS("http://www.w3.org/2000/svg", "svg"));
37 is(t
.firstChild
.namespaceURI
, "http://www.w3.org/2000/svg");
38 t
.firstChild
.appendChild(document
.createElementNS("http://www.w3.org/2000/svg", "script"));
39 is(t
.firstChild
.firstChild
.namespaceURI
, "http://www.w3.org/2000/svg");
40 t
.firstChild
.firstChild
.textContent
= "1&2<3>4\xA0";
41 is(t
.innerHTML
, '<svg><script>1&2<3>4 \u003C/script></svg>');
44 t
.appendChild(document
.createElementNS("http://www.w3.org/2000/svg", "svg"));
45 is(t
.firstChild
.namespaceURI
, "http://www.w3.org/2000/svg");
46 t
.firstChild
.appendChild(document
.createElementNS("http://www.w3.org/2000/svg", "style"));
47 is(t
.firstChild
.firstChild
.namespaceURI
, "http://www.w3.org/2000/svg");
48 t
.firstChild
.firstChild
.textContent
= "1&2<3>4\xA0";
49 is(t
.innerHTML
, '<svg><style>1&2<3>4 \u003C/style></svg>');
52 // Tests for Bug 1673237
55 // This test fails if about:blank renders SVGs
57 var iframe
= document
.createElement("iframe");
58 iframe
.setAttribute("src", "about:blank")
59 t
.appendChild(iframe
);
60 iframe
.appendChild(document
.createElementNS("http://www.w3.org/2000/svg", "svg:svg"));
61 iframe
.firstChild
.textContent
= "<foo>";
62 is(iframe
.innerHTML
, "<svg:svg><foo></svg:svg>");
64 // This test fails if about:blank renders SVGs
65 var win
= window
.open("about:blank");
66 win
.document
.body
.appendChild(document
.createElementNS("http://www.w3.org/2000/svg", "svg:svg"))
67 win
.document
.body
.firstChild
.textContent
= "<foo>";
68 is(win
.document
.body
.innerHTML
, "<svg:svg><foo></svg:svg>");
71 // This test fails if about:srcdoc renders SVGs
73 iframe
= document
.createElement("iframe");
74 iframe
.srcdoc
= "<svg:svg></svg:svg>";
75 iframe
.onload = function() {
76 iframe
.contentDocument
.body
.firstChild
.textContent
= "<foo>";
77 is(iframe
.contentDocument
.body
.innerHTML
, "<svg:svg><foo></svg:svg>");
80 t
.appendChild(iframe
);