2 <p>Test of createContextualFragment from a Range whose context is a document. If the test succeeds you will see the word
"PASS" below.
</p>
6 testRunner
.dumpAsText();
8 var range
= document
.createRange();
9 var fragment
= range
.createContextualFragment('<p id="fragment">Inserted fragment</p>');
10 document
.body
.appendChild(fragment
);
11 var p
= document
.getElementById('fragment');
13 var result
= document
.getElementById('result');
14 result
.textContent
= (p
&& p
.parentElement
=== document
.body
&& p
.namespaceURI
=== 'http://www.w3.org/1999/xhtml') ? 'PASS' : 'FAIL';