blob: 117712563d5254fffd25c3ade7d73c6f442a9c36 [file] [log] [blame]
<!DOCTYPE html>
<title>HTMLTableRowElement.rowIndex</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
var row = document.createElement("table")
.appendChild(document.createElement("div"))
.appendChild(document.createElement("tr"));
assert_equals(row.rowIndex, -1);
});
test(function() {
var row = document.createElement("table")
.appendChild(document.createElement("thead"))
.appendChild(document.createElement("tr"));
assert_equals(row.rowIndex, 0);
});
test(function() {
var row = document.createElement("table")
.appendChild(document.createElement("tbody"))
.appendChild(document.createElement("tr"));
assert_equals(row.rowIndex, 0);
});
test(function() {
var row = document.createElement("table")
.appendChild(document.createElement("tfoot"))
.appendChild(document.createElement("tr"));
assert_equals(row.rowIndex, 0);
});
test(function() {
var row = document.createElement("table")
.appendChild(document.createElement("tr"));
assert_equals(row.rowIndex, 0);
});
test(function() {
var row = document.createElementNS("", "table")
.appendChild(document.createElement("thead"))
.appendChild(document.createElement("tr"));
assert_equals(row.rowIndex, -1);
});
test(function() {
var row = document.createElementNS("", "table")
.appendChild(document.createElement("tbody"))
.appendChild(document.createElement("tr"));
assert_equals(row.rowIndex, -1);
});
test(function() {
var row = document.createElementNS("", "table")
.appendChild(document.createElement("tfoot"))
.appendChild(document.createElement("tr"));
assert_equals(row.rowIndex, -1);
});
test(function() {
var row = document.createElementNS("", "table")
.appendChild(document.createElement("tr"));
assert_equals(row.rowIndex, -1);
});
test(function() {
var row = document.createElement("table")
.appendChild(document.createElementNS("", "thead"))
.appendChild(document.createElement("tr"));
assert_equals(row.rowIndex, -1);
});
test(function() {
var row = document.createElement("table")
.appendChild(document.createElementNS("", "tbody"))
.appendChild(document.createElement("tr"));
assert_equals(row.rowIndex, -1);
});
test(function() {
var row = document.createElement("table")
.appendChild(document.createElementNS("", "tfoot"))
.appendChild(document.createElement("tr"));
assert_equals(row.rowIndex, -1);
});
</script>