OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <meta charset="utf-8"> |
| 3 <title>HTMLTableRowElement#deleteCell</title> |
| 4 <link rel="author" title="Intel" href="http://www.intel.com/"> |
| 5 <script src="../../../../../../resources/testharness.js"></script> |
| 6 <script src="../../../../../../resources/testharnessreport.js"></script> |
| 7 |
| 8 <div id="log"></div> |
| 9 |
| 10 <table> |
| 11 <tr id="testTr"> |
| 12 <td>ABCDE</td> |
| 13 <td>12345</td> |
| 14 <td>ABC12</td> |
| 15 </tr> |
| 16 </table> |
| 17 |
| 18 <script> |
| 19 |
| 20 var tr = document.getElementById("testTr"); |
| 21 |
| 22 test(function () { |
| 23 tr.deleteCell(0); |
| 24 assert_equals(tr.cells[0].innerHTML, "12345"); |
| 25 assert_equals(tr.cells.length, 2); |
| 26 }, "HTMLTableRowElement deleteCell(0)"); |
| 27 |
| 28 test(function () { |
| 29 tr.deleteCell(-1); |
| 30 assert_equals(tr.cells[tr.cells.length - 1].innerHTML, "12345"); |
| 31 assert_equals(tr.cells.length, 1); |
| 32 }, "HTMLTableRowElement deleteCell(-1)"); |
| 33 |
| 34 test(function () { |
| 35 assert_throws("IndexSizeError", function () { |
| 36 tr.deleteCell(-2); |
| 37 }); |
| 38 }, "HTMLTableRowElement deleteCell(-2)"); |
| 39 |
| 40 test(function () { |
| 41 assert_throws("IndexSizeError", function () { |
| 42 tr.deleteCell(tr.cells.length); |
| 43 }); |
| 44 }, "HTMLTableRowElement deleteCell(cells.length)"); |
| 45 |
| 46 </script> |
OLD | NEW |