Reviewed by Darin.
[WebKit-https.git] / LayoutTests / fast / dom / import-document-fragment.html
1 <script>
2 if (window.layoutTestController)
3   layoutTestController.dumpAsText();
4
5 try {
6   var xmld = new DOMParser().parseFromString( "<doc/>", "text/xml");
7
8   var fragment = document.createDocumentFragment();
9   fragment.appendChild(document.createTextNode("1"));
10   fragment.appendChild(document.createTextNode("2"));
11
12   var importedFragment = xmld.importNode(fragment, true);
13   xmld.firstChild.appendChild(importedFragment);
14   if (xmld.firstChild.textContent != "12")
15     throw "wrong imported DOM tree: '" + xmld.firstChild.textContent + "'";
16
17   document.write("<div>SUCCESS</div>");
18 } catch (ex) {
19   document.write("<div>" + ex + "</div>");
20 }
21 </script>