1description('Test behavior of the HTMLTableSectionElement rows attribute in cases where there is unusual nesting.'); 2 3function checkRowNesting(tag) 4{ 5 var body = document.createElement("tbody"); 6 var container = document.createElement(tag); 7 var row = document.createElement("tr"); 8 body.appendChild(container); 9 container.appendChild(row); 10 return body.rows.length; 11} 12 13var sectionTags = [ 14 "tbody", 15 "tfoot", 16 "thead", 17]; 18 19var otherTags = [ 20 "col", 21 "colgroup", 22 "div", 23 "form", 24 "script", 25 "table", 26 "td", 27 "th", 28]; 29 30for (i = 0; i < otherTags.length; ++i) 31 shouldBe('checkRowNesting("' + otherTags[i] + '")', '0'); 32 33debug(''); 34 35for (i = 0; i < sectionTags.length; ++i) 36 shouldBe('checkRowNesting("' + sectionTags[i] + '")', '0'); 37 38debug(''); 39 40shouldBe('checkRowNesting("tr")', '1'); 41 42debug(''); 43 44var successfullyParsed = true; 45