| OLD | NEW |
| (Empty) |
| 1 description('An excerpt from an early Acid3 test 65: construct a table, and see
if the table is as expected'); | |
| 2 | |
| 3 var table = document.createElement('table'); | |
| 4 table.appendChild(document.createElement('tbody')); | |
| 5 var tr1 = document.createElement('tr'); | |
| 6 table.appendChild(tr1); | |
| 7 table.appendChild(document.createElement('caption')); | |
| 8 table.appendChild(document.createElement('thead')); | |
| 9 // <table><tbody/><tr/><caption/><thead/> | |
| 10 table.insertBefore(table.firstChild.nextSibling, null); // move the <tr/> to the
end | |
| 11 // <table><tbody/><caption/><thead/><tr/> | |
| 12 table.replaceChild(table.firstChild, table.lastChild); // move the <tbody/> to t
he end and remove the <tr> | |
| 13 // <table><caption/><thead/><tbody/> | |
| 14 var tr2 = table.tBodies[0].insertRow(0); | |
| 15 // <table><caption/><thead/><tbody><tr/></tbody> | |
| 16 shouldBe("table.tBodies[0].rows[0].rowIndex", "0"); | |
| 17 shouldBe("table.tBodies[0].rows[0].sectionRowIndex", "0"); | |
| 18 shouldBe("table.childNodes.length", "3"); | |
| 19 shouldBe("!!table.caption", "true"); | |
| 20 shouldBe("!!table.tHead", "true"); | |
| 21 shouldBe("table.tFoot", "null"); | |
| 22 shouldBe("table.tBodies.length", "1"); | |
| 23 shouldBe("table.rows.length", "1"); | |
| 24 shouldBe("tr1.parentNode", "null"); | |
| 25 shouldBe("table.caption", "table.createCaption()"); | |
| 26 shouldBe("table.tFoot", "null"); | |
| 27 shouldBe("table.tHead", "table.createTHead()"); | |
| 28 shouldBe("table.createTFoot()", "table.tFoot"); | |
| 29 // either: <table><caption/><thead/><tbody><tr/></tbody><tfoot/> | |
| 30 // or: <table><caption/><thead/><tfoot/><tbody><tr/></tbody> | |
| 31 table.tHead.appendChild(tr1); | |
| 32 // either: <table><caption/><thead><tr/></thead><tbody><tr/></tbody><tfoot/> | |
| 33 // or: <table><caption/><thead><tr/></thead><tfoot/><tbody><tr/></tbody> | |
| 34 shouldBe("table.rows[0]", "table.tHead.firstChild"); | |
| 35 shouldBe("table.rows.length", "2"); | |
| 36 shouldBe("table.rows[1]", "table.tBodies[0].firstChild"); | |
| OLD | NEW |