<!doctypehtml>
<script>
window.is = window.parent.is;
window.SimpleTest = window.parent.SimpleTest;
</script>
<div id="testnodes"><span>hi</span> there <!-- mon ami --></div>
<script>
let t = document.getElementById('testnodes');
t.innerHTML = null;
t.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg:svg"));
t.firstChild.textContent = "";
is(t.innerHTML, "<foo>");
// This test crashes if the style tags are not handled correctly
t.innerHTML = `<svg version="1.1">
<style>
circle {
fill: currentColor;
}
</style>
<g><circle cx="25.8" cy="9.3" r="1.5"/></g>
</svg>
`;
is(t.firstChild.tagName.toLowerCase(), 'svg');
// This test crashes if the script tags are not handled correctly
t.innerHTML = `<svg version="1.1">
<scri` + `pt>
throw "badment, should never fire.";
</scri` + `pt>
<g><circle cx="25.8" cy="9.3" r="1.5"/></g>
</svg>`;
is(t.firstChild.tagName.toLowerCase(), 'svg');