Implement deleteRow and insertRow for <table> element

Continued from #6936
This commit is contained in:
Corey Farwell 2015-10-04 17:17:45 -04:00
parent 02d8894945
commit 3d383f21ae
8 changed files with 81 additions and 77 deletions

View file

@ -43,4 +43,12 @@ test(function () {
});
}, "HTMLTableSectionElement deleteRow(-2)");
test(function () {
assert_equals(tbody.rows.length, 1);
tbody.deleteRow(-1);
assert_equals(tbody.rows.length, 0);
tbody.deleteRow(-1);
assert_equals(tbody.rows.length, 0);
}, "HTMLTableSectionElement deleteRow(-1) with no rows");
</script>

View file

@ -35,6 +35,12 @@ test(function () {
assert_equals(tbody.rows.length, 4);
}, "HTMLTableSectionElement insertRow()");
test(function () {
var trEle = tbody.insertRow(tbody.rows.length);
assert_equals(tbody.rows[tbody.rows.length - 1], trEle);
assert_equals(tbody.rows.length, 5);
}, "HTMLTableSectionElement insertRow(rows.length)");
test(function () {
assert_throws("IndexSizeError", function () {
tbody.insertRow(-2);