| 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('Test behavior of the HTMLTableRowElement cells attribute in cases w
here there is unusual nesting.'); | |
| 9 | |
| 10 function checkCellNesting(tag) | |
| 11 { | |
| 12 var row = document.createElement("tr"); | |
| 13 var container = document.createElement(tag); | |
| 14 var cell = document.createElement("td"); | |
| 15 row.appendChild(container); | |
| 16 container.appendChild(cell); | |
| 17 return row.cells.length; | |
| 18 } | |
| 19 | |
| 20 function checkHeaderCellNesting(tag) | |
| 21 { | |
| 22 var row = document.createElement("tr"); | |
| 23 var container = document.createElement(tag); | |
| 24 var cell = document.createElement("th"); | |
| 25 row.appendChild(container); | |
| 26 container.appendChild(cell); | |
| 27 return row.cells.length; | |
| 28 } | |
| 29 | |
| 30 var tags = [ | |
| 31 "col", | |
| 32 "colgroup", | |
| 33 "div", | |
| 34 "form", | |
| 35 "script", | |
| 36 "table", | |
| 37 "tbody", | |
| 38 "tfoot", | |
| 39 "thead", | |
| 40 "tr", | |
| 41 ]; | |
| 42 | |
| 43 for (i = 0; i < tags.length; ++i) | |
| 44 shouldBe('checkCellNesting("' + tags[i] + '")', '0'); | |
| 45 | |
| 46 debug(''); | |
| 47 | |
| 48 shouldBe('checkCellNesting("td")', '1'); | |
| 49 shouldBe('checkCellNesting("th")', '1'); | |
| 50 | |
| 51 debug(''); | |
| 52 | |
| 53 for (i = 0; i < tags.length; ++i) | |
| 54 shouldBe('checkHeaderCellNesting("' + tags[i] + '")', '0'); | |
| 55 | |
| 56 debug(''); | |
| 57 | |
| 58 shouldBe('checkHeaderCellNesting("td")', '1'); | |
| 59 shouldBe('checkHeaderCellNesting("th")', '1'); | |
| 60 | |
| 61 debug(''); | |
| 62 </script> | |
| 63 </body> | |
| 64 </html> | |
| OLD | NEW |