<!DOCTYPE html>
<p>Test of createContextualFragment from a Range whose container is an SVG element. If the test succeeds you will see the word "PASS" below.</p>
<p id="result"></p>
<svg width="300px" height="50px" viewBox="0 0 300 24" id="container">
</svg>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var contextSvg = document.getElementById('container');
var range = document.createRange();
range.setStart(contextSvg, 0);
var fragment = range.createContextualFragment('<text id="fragment" x="0" y="16" fontsize="16">Inserted fragment</text>');
contextSvg.appendChild(fragment);
var text = document.getElementById('fragment');
var result = document.getElementById('result');
result.textContent = (text && text.parentElement === contextSvg && text.namespaceURI === 'http://www.w3.org/2000/svg') ? 'PASS' : 'FAIL';
</script>