| OLD | NEW |
| (Empty) |
| 1 description('Test behavior of the HTMLTableElement rows attribute in cases where
there is unusual nesting.'); | |
| 2 | |
| 3 function checkNoBodyRowNesting(tag) | |
| 4 { | |
| 5 var table = document.createElement("table"); | |
| 6 var container = document.createElement(tag); | |
| 7 var row = document.createElement("tr"); | |
| 8 table.appendChild(container); | |
| 9 container.appendChild(row); | |
| 10 return table.rows.length; | |
| 11 } | |
| 12 | |
| 13 function checkRowNesting(tag) | |
| 14 { | |
| 15 var table = document.createElement("table"); | |
| 16 var body = document.createElement("tbody"); | |
| 17 var container = document.createElement(tag); | |
| 18 var row = document.createElement("tr"); | |
| 19 table.appendChild(body); | |
| 20 body.appendChild(container); | |
| 21 container.appendChild(row); | |
| 22 return table.rows.length; | |
| 23 } | |
| 24 | |
| 25 var sectionTags = [ | |
| 26 "tbody", | |
| 27 "tfoot", | |
| 28 "thead", | |
| 29 ]; | |
| 30 | |
| 31 var otherTags = [ | |
| 32 "col", | |
| 33 "colgroup", | |
| 34 "div", | |
| 35 "form", | |
| 36 "script", | |
| 37 "table", | |
| 38 "td", | |
| 39 "th", | |
| 40 ]; | |
| 41 | |
| 42 for (i = 0; i < otherTags.length; ++i) | |
| 43 shouldBe('checkRowNesting("' + otherTags[i] + '")', '0'); | |
| 44 | |
| 45 debug(''); | |
| 46 | |
| 47 for (i = 0; i < sectionTags.length; ++i) | |
| 48 shouldBe('checkRowNesting("' + sectionTags[i] + '")', '0'); | |
| 49 | |
| 50 debug(''); | |
| 51 | |
| 52 shouldBe('checkRowNesting("tr")', '1'); | |
| 53 | |
| 54 debug(''); | |
| 55 | |
| 56 for (i = 0; i < otherTags.length; ++i) | |
| 57 shouldBe('checkNoBodyRowNesting("' + otherTags[i] + '")', '0'); | |
| 58 | |
| 59 debug(''); | |
| 60 | |
| 61 for (i = 0; i < sectionTags.length; ++i) | |
| 62 shouldBe('checkNoBodyRowNesting("' + sectionTags[i] + '")', '1'); | |
| 63 | |
| 64 debug(''); | |
| 65 | |
| 66 shouldBe('checkNoBodyRowNesting("tr")', '1'); | |
| 67 | |
| 68 debug(''); | |
| OLD | NEW |