OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <link rel="help" href="http://www.whatwg.org/specs/web-apps/current-work/multipa
ge/tabular-data.html#dom-tbody-insertrow"> | |
5 <script src="../../../resources/js-test.js"></script> | |
6 </head> | |
7 <body> | |
8 <script> | |
9 description("Tests that HTMLTableSectionElement.insertRow() skips non <tr>
children."); | |
10 | |
11 var tb = document.createElement("tbody"); | |
12 shouldBe("tb.__proto__", "HTMLTableSectionElement.prototype"); | |
13 | |
14 tb.appendChild(new Text("TEXT")); | |
15 tb.appendChild(document.createElement("a")); | |
16 tb.insertRow(-1).innerHTML = "1"; | |
17 // The insertRow() method must create a tr element, insert it as a child of the | |
18 // table section element, immediately before the indexth tr element in the rows | |
19 // collection, and finally must return the newly created tr element. | |
20 tb.insertRow(0).innerHTML = "0"; | |
21 | |
22 var childNodes = tb.childNodes; | |
23 shouldBe("childNodes.length", "4"); | |
24 shouldBeEqualToString("childNodes[0].nodeValue", "TEXT"); | |
25 shouldBeEqualToString("childNodes[1].tagName", "A"); | |
26 shouldBeEqualToString("childNodes[2].innerHTML", "0"); | |
27 shouldBeEqualToString("childNodes[3].innerHTML", "1"); | |
28 </script> | |
29 </body> | |
30 </html> | |
OLD | NEW |