4 <link rel=
"help" href=
"http://www.whatwg.org/specs/web-apps/current-work/multipage/tabular-data.html#dom-tr-insertcell">
5 <script src=
"../../../resources/js-test.js"></script>
9 description("Tests that HTMLTableRowElement.insertCell() skips non <td> / <th> children.");
11 var tr
= document
.createElement("tr");
12 shouldBe("tr.__proto__", "HTMLTableRowElement.prototype");
14 tr
.appendChild(new Text("TEXT"));
15 tr
.appendChild(document
.createElement("a"));
16 tr
.insertCell(-1).innerHTML
= "1";
17 // The insertCell() method must create a td element, insert it as a child of the
18 // tr element, immediately before the indexth td or th element in the cells
19 // collection, and finally must return the newly created td element.
20 tr
.insertCell(0).innerHTML
= "0";
22 var childNodes
= tr
.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");