Chromium Code Reviews| Index: LayoutTests/fast/dom/HTMLTableRowElement/insertCell-skips-non-td-th.html |
| diff --git a/LayoutTests/fast/dom/HTMLTableRowElement/insertCell-skips-non-td-th.html b/LayoutTests/fast/dom/HTMLTableRowElement/insertCell-skips-non-td-th.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..165cccfd8bc3040071f85a6bb4da086f3e105b41 |
| --- /dev/null |
| +++ b/LayoutTests/fast/dom/HTMLTableRowElement/insertCell-skips-non-td-th.html |
| @@ -0,0 +1,30 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<link rel="help" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/tabular-data.html#dom-tr-insertcell"> |
| +<script src="../../../resources/js-test.js"></script> |
| +</head> |
| +<body> |
| +<script> |
| +description("Tests that HTMLTableRowElement.insertCell() skips non <td> / <th> children."); |
| + |
| +var tr = document.createElement("tr"); |
| +shouldBe("tr.__proto__", "HTMLTableRowElement.prototype"); |
| + |
| +tr.appendChild(new Text("TEXT")); |
| +tr.appendChild(document.createElement("a")); |
| +tr.insertCell(-1).innerHTML = "1"; |
| +// The insertRow() method must create a td element, insert it as a child of the |
|
tkent
2014/05/07 01:18:23
insetRow() -> insertCell().
Inactive
2014/05/07 01:37:13
Done.
|
| +// tr element, immediately before the indexth td or th element in the cells |
| +// collection, and finally must return the newly created td element. |
| +tr.insertCell(0).innerHTML = "0"; |
| + |
| +var childNodes = tr.childNodes; |
| +shouldBe("childNodes.length", "4"); |
| +shouldBeEqualToString("childNodes[0].nodeValue", "TEXT"); |
| +shouldBeEqualToString("childNodes[1].tagName", "A"); |
| +shouldBeEqualToString("childNodes[2].innerHTML", "0"); |
| +shouldBeEqualToString("childNodes[3].innerHTML", "1"); |
| +</script> |
| +</body> |
| +</html> |