Skip to content

Commit

Permalink
Implement HTMLTableCellElement::CellIndex
Browse files Browse the repository at this point in the history
Extracted from #6936
  • Loading branch information
frewsxcv authored and Ms2ger committed Oct 21, 2015
1 parent 9a49a8e commit a6c2cbe
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,13 @@
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>

0 comments on commit a6c2cbe

Please sign in to comment.