From d4c8a434cde02ae1ba37821d292e33142cf95a88 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Mon, 12 Oct 2015 16:59:39 +0200 Subject: [PATCH] Implement deleteRow and insertRow for element Continued from #6936 --- .../tabular-data/the-tbody-element/deleteRow.html | 8 ++++++++ .../tabular-data/the-tbody-element/insertRow.html | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/html/semantics/tabular-data/the-tbody-element/deleteRow.html b/html/semantics/tabular-data/the-tbody-element/deleteRow.html index 820c7dd87b0553..c81abd82600f65 100644 --- a/html/semantics/tabular-data/the-tbody-element/deleteRow.html +++ b/html/semantics/tabular-data/the-tbody-element/deleteRow.html @@ -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"); + diff --git a/html/semantics/tabular-data/the-tbody-element/insertRow.html b/html/semantics/tabular-data/the-tbody-element/insertRow.html index 1318323986e00d..4c13db7aa5f6b7 100644 --- a/html/semantics/tabular-data/the-tbody-element/insertRow.html +++ b/html/semantics/tabular-data/the-tbody-element/insertRow.html @@ -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);