Skip to content

Commit

Permalink
Implement deleteRow and insertRow for <table> element
Browse files Browse the repository at this point in the history
Continued from #6936
  • Loading branch information
frewsxcv authored and Ms2ger committed Oct 12, 2015
1 parent 116d489 commit d4c8a43
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions html/semantics/tabular-data/the-tbody-element/deleteRow.html
Expand Up @@ -43,4 +43,12 @@
});
}, "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>
6 changes: 6 additions & 0 deletions html/semantics/tabular-data/the-tbody-element/insertRow.html
Expand Up @@ -35,6 +35,12 @@
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);
Expand Down

0 comments on commit d4c8a43

Please sign in to comment.