blob: 391f7d98260f841e1860442d459e28b4c8bc8437 [file] [log] [blame]
<!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">
if (window.testRunner)
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>');
var text = document.getElementById('fragment');
var result = document.getElementById('result');
result.textContent = (text && text.parentElement === contextSvg && text.namespaceURI === '') ? 'PASS' : 'FAIL';