Auto merge of #7829 - frewsxcv:htmltablecellelement-cellindex, r=Ms2ger

Implement HTMLTableCellElement::CellIndex

Extracted from #6936

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7829)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-10-14 07:39:24 -06:00
commit 55769b2fbf
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>