OLD | NEW |
1 <html> | 1 <script src="../../resources/js-test.js"></script> |
2 <body> | |
3 <script> | |
4 if (window.testRunner) | |
5 testRunner.dumpAsText(); | |
6 </script> | |
7 | 2 |
8 <div id="div"> | 3 <div id="div"> |
9 <table id="table"> | 4 <table id="table"> |
10 <script> | 5 <script> |
11 var table = document.getElementById('table'); | 6 var table = document.getElementById('table'); |
12 table.parentNode.removeChild(table); | 7 table.parentNode.removeChild(table); |
13 var docFragment = document.createDocumentFragment(); | 8 var docFragment = document.createDocumentFragment(); |
14 docFragment.appendChild(table); | 9 docFragment.appendChild(table); |
15 </script> | 10 </script> |
16 <h1 id="h1">Otherwise, if there is a table element in the stack of open elem
ents, but the last table element in the stack of open elements has no parent, or
its parent node is not an element, then the foster parent element is the elemen
t before the last table element in the stack of open elements.</h1> | 11 <h1></h1> |
17 </table> | 12 </table> |
18 </div> | 13 </div> |
19 | 14 |
20 <script> | 15 <script> |
| 16 description("Tests the HTML foster parenting algorithm when a DocumentFragment i
s the chosen foster parent"); |
21 var div = document.getElementById('div'); | 17 var div = document.getElementById('div'); |
22 var h1 = document.getElementById('h1'); | |
23 | 18 |
24 if (h1 && h1 === div.firstElementChild) | 19 shouldBe("div.children.length", "0"); |
25 document.write("success"); | 20 shouldBe("docFragment.firstElementChild.tagName", "'H1'"); |
26 else | |
27 document.write("failure"); | |
28 </script> | 21 </script> |
29 </body> | |
30 </html> | |
OLD | NEW |