| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../../resources/js-test.js"></script> | |
| 5 </head> | |
| 6 <body> | |
| 7 <script> | |
| 8 description('An excerpt from an early Acid3 test 66: test the ordering and creat
ion of rows'); | |
| 9 | |
| 10 var table = document.createElement('table'); | |
| 11 var rows = [ | |
| 12 document.createElement('tr'), // 0: ends up first child of the tfoot | |
| 13 document.createElement('tr'), // 1: goes at the end of the table | |
| 14 document.createElement('tr'), // 2: becomes second child of thead | |
| 15 document.createElement('tr'), // 3: becomes third child of the thead | |
| 16 document.createElement('tr'), // 4: not in the table | |
| 17 table.insertRow(0), // 5: not in the table | |
| 18 table.createTFoot().insertRow(0) // 6: ends up second in the tfoot | |
| 19 ]; | |
| 20 rows[6].parentNode.appendChild(rows[0]); | |
| 21 table.appendChild(rows[1]); | |
| 22 table.insertBefore(document.createElement('thead'), table.firstChild); | |
| 23 table.firstChild.appendChild(rows[2]); | |
| 24 rows[2].parentNode.appendChild(rows[3]); | |
| 25 rows[4].appendChild(rows[5].parentNode); | |
| 26 table.insertRow(0); | |
| 27 table.tFoot.appendChild(rows[6]); | |
| 28 | |
| 29 shouldBe("table.rows.length", "6"); | |
| 30 shouldBe("table.getElementsByTagName('tr').length", "6"); | |
| 31 shouldBe("table.childNodes.length", "3"); | |
| 32 shouldBe("table.tHead", "table.childNodes[0]"); | |
| 33 shouldBe("table.tHead.childNodes[0]", "table.getElementsByTagName('tr')[0]"); | |
| 34 shouldBe("table.tHead.childNodes[1]", "table.getElementsByTagName('tr')[1]"); | |
| 35 shouldBe("rows[2]", "table.getElementsByTagName('tr')[1]"); | |
| 36 shouldBe("table.tHead.childNodes[2]", "table.getElementsByTagName('tr')[2]"); | |
| 37 shouldBe("rows[3]", "table.getElementsByTagName('tr')[2]"); | |
| 38 shouldBe("table.tFoot", "table.childNodes[1]"); | |
| 39 shouldBe("table.tFoot.childNodes[0]", "table.getElementsByTagName('tr')[3]"); | |
| 40 shouldBe("rows[0]", "table.getElementsByTagName('tr')[3]"); | |
| 41 shouldBe("table.tFoot.childNodes[1]", "table.getElementsByTagName('tr')[4]"); | |
| 42 shouldBe("rows[6]", "table.getElementsByTagName('tr')[4]"); | |
| 43 shouldBe("table.childNodes[2]", "table.getElementsByTagName('tr')[5]"); | |
| 44 shouldBe("rows[1]", "table.getElementsByTagName('tr')[5]"); | |
| 45 shouldBe("table.tBodies.length", "0"); | |
| 46 </script> | |
| 47 </body> | |
| 48 </html> | |
| OLD | NEW |