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