Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / allowed-children.html
blob7108e72c8c4a3cdda1cf2a8eda48f52eefa502f7
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 </head>
5 <body>
6 <script>
7 description("This test ensures that we can attach various DOMs to the document.");
9 var cases = [
11 "markup": "<Long />",
12 "tagName": "'Long'",
13 "serialization": "'<Long/>'"
14 }, {
15 "markup": "<Long><b>15</b></Long>",
16 "tagName": "'Long'",
17 "serialization": "'<Long><b>15</b></Long>'"
18 }, {
19 "markup": "<Long id='1'>1</Long>",
20 "tagName": "'Long'",
21 "serialization": "'<Long id=\"1\">1</Long>'"
22 }, {
23 "markup": "<Long id='1'>15<b>1</b>16</Long>",
24 "tagName": "'Long'",
25 "serialization": "'<Long id=\"1\">15<b>1</b>16</Long>'"
29 for (var i = 0; i < cases.length; ++i) {
30 var doc = document.implementation.createDocument("", "", null);
31 var doc2 = (new DOMParser()).parseFromString(cases[i].markup, "text/xml");
32 var u = doc.importNode(doc2.childNodes[0], true);
33 shouldBe("u.tagName", cases[i].tagName);
34 doc.appendChild(u);
35 shouldBe("(new XMLSerializer()).serializeToString(doc)", cases[i].serialization);
37 </script>
38 </body>
39 </html>