Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / dom / Range / create-contextual-fragment-from-xhtml-document-range.xhtml
1 <?xml version="1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5   <title>createContextualFragment from &lt;html&gt; element range in XHTML document.</title>
6 </head>
7 <body>
8 <p>Test of createContextualFragment from a Range whose context is an XHTML document. If the test succeeds you will see the word "PASS" below.</p>
9 <p id="result"></p>
10 <script>
11 if (window.testRunner)
12     testRunner.dumpAsText();
13
14 var range = document.createRange();
15 var fragment = range.createContextualFragment('&lt;p id="frag">Inserted fragment&lt;/p>');
16 document.body.appendChild(fragment);
17 var p = document.getElementById('frag');
18
19 var result = document.getElementById('result');
20 result.textContent = (p &amp;&amp; p.parentElement === document.body &amp;&amp; p.namespaceURI === 'http://www.w3.org/1999/xhtml') ? 'PASS' : 'FAIL';
21 </script>
22 </body>
23 </html>