blob: b5a7a331cf71b33c9f44c477177c9f833a0da9ce [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../js/resources/js-test-pre.js"></script>
</head>
<body>
<script>
description('Testcase for bug <a href="http://webkit.org/b/93738">http://webkit.org/b/93738 </a>. \
The testcase checks if the cellIndex of a table cell(td/th) is correct when the cell is inside different parents.');
debug('The cellIndex of a table cell (td/th) must be -1 if its parent is other than a table row. Otherwise \
the cellIndex must be a value greater than or equal to 0.');
th_with_no_parent = document.createElement("th");
shouldBe('th_with_no_parent.cellIndex', '-1');
td_with_no_parent = document.createElement("td");
shouldBe('td_with_no_parent.cellIndex', '-1');
table = document.createElement("table");
th_with_table_parent = table.appendChild(document.createElement("th"));
shouldBe('th_with_table_parent.cellIndex', '-1');
td_with_table_parent = table.appendChild(document.createElement("td"));
shouldBe('td_with_table_parent.cellIndex', '-1');
thead = document.createElement("thead");
th_with_thead_parent = thead.appendChild(document.createElement("th"));
shouldBe('th_with_thead_parent.cellIndex', '-1');
td_with_thead_parent = thead.appendChild(document.createElement("td"));
shouldBe('td_with_thead_parent.cellIndex', '-1');
tbody = document.createElement("tbody");
th_with_tbody_parent = tbody.appendChild(document.createElement("th"));
shouldBe('th_with_tbody_parent.cellIndex', '-1');
td_with_tbody_parent = tbody.appendChild(document.createElement("td"));
shouldBe('td_with_tbody_parent.cellIndex', '-1');
tfoot = document.createElement("tfoot");
th_with_tfoot_parent = tfoot.appendChild(document.createElement("th"));
shouldBe('th_with_tfoot_parent.cellIndex', '-1');
td_with_tfoot_parent = tfoot.appendChild(document.createElement("td"));
shouldBe('td_with_table_parent.cellIndex', '-1');
tr = document.createElement("tr");
first_cell_th_with_tr_parent = tr.appendChild(document.createElement("th"));
shouldBe('first_cell_th_with_tr_parent.cellIndex', '0');
second_cell_td_with_tr_parent = tr.appendChild(document.createElement("td"));
shouldBe('second_cell_td_with_tr_parent.cellIndex', '1');
</script>
<script src="../js/resources/js-test-post.js"></script>
</body>
</html>