OLD | NEW |
1 // https://html.spec.whatwg.org/multipage/#dom-tbody-rows | 1 // https://html.spec.whatwg.org/multipage/#dom-tbody-rows |
2 function testRowsAttribute(localName) { | 2 function testRowsAttribute(localName) { |
3 var elem = document.createElement(localName); | 3 var elem = document.createElement(localName); |
4 assert_equals(elem.rows.length, 0); | 4 assert_equals(elem.rows.length, 0); |
5 | 5 |
6 // Child <p> should *not* count as a row | 6 // Child <p> should *not* count as a row |
7 elem.appendChild(document.createElement("p")); | 7 elem.appendChild(document.createElement("p")); |
8 assert_equals(elem.rows.length, 0); | 8 assert_equals(elem.rows.length, 0); |
9 | 9 |
10 // Child <tr> should count as a row | 10 // Child <tr> should count as a row |
11 var childTr = document.createElement("tr"); | 11 var childTr = document.createElement("tr"); |
12 elem.appendChild(childTr); | 12 elem.appendChild(childTr); |
13 assert_equals(elem.rows.length, 1); | 13 assert_equals(elem.rows.length, 1); |
14 | 14 |
15 // Nested table with child <tr> should *not* count as a row | 15 // Nested table with child <tr> should *not* count as a row |
16 var nested = document.createElement(localName); | 16 var nested = document.createElement(localName); |
17 nested.appendChild(document.createElement("tr")); | 17 nested.appendChild(document.createElement("tr")); |
18 var nestedTable = document.createElement("table"); | 18 var nestedTable = document.createElement("table"); |
19 nestedTable.appendChild(nested); | 19 nestedTable.appendChild(nested); |
20 childTr.appendChild(nestedTable); | 20 childTr.appendChild(nestedTable); |
21 assert_equals(elem.rows.length, 1); | 21 assert_equals(elem.rows.length, 1); |
22 } | 22 } |
OLD | NEW |