Implement HTMLTableCellElement::CellIndex

Extracted from #6936
This commit is contained in:
Corey Farwell 2015-10-02 07:46:44 -04:00
parent ad94ef5a96
commit 899f1cab58
5 changed files with 29 additions and 28 deletions

View file

@ -38,4 +38,13 @@ test(function() {
var td = tr.appendChild(document.createElement("td"));
assert_equals(td.cellIndex, 1);
}, "For cells whose parent is a tr, cellIndex should be the index.")
test(function() {
var tr = document.createElement("tr");
var th = tr.appendChild(document.createElement("th"));
assert_equals(th.cellIndex, 0);
tr.appendChild(document.createElement("div"));
tr.appendChild(document.createTextNode("Hello World"));
var td = tr.appendChild(document.createElement("td"));
assert_equals(td.cellIndex, 1)
}, "For cells whose parent is a tr with non td/th sibling, cellIndex should skip those non td/th siblings.")
</script>