| <!DOCTYPE html> |
| <html> |
| <head> |
| <link rel="help" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/tabular-data.html#the-tbody-element"> |
| <script src="../../../resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <script> |
| description("Tests that HTMLTableSectionElement.insertRow()'s default argument is -1."); |
| |
| var tb = document.createElement("tbody"); |
| shouldBe("tb.__proto__", "HTMLTableSectionElement.prototype"); |
| |
| tb.insertRow().innerHTML = "1"; // Should append. |
| tb.insertRow().innerHTML = "2"; // Should append. |
| tb.insertRow(-1).innerHTML = "3"; // Should append. |
| tb.insertRow(0).innerHTML = "0"; // Should prepend. |
| |
| var rows = tb.rows; |
| shouldBe("rows.length", "4"); |
| shouldBeEqualToString("rows[0].innerHTML", "0"); |
| shouldBeEqualToString("rows[1].innerHTML", "1"); |
| shouldBeEqualToString("rows[2].innerHTML", "2"); |
| shouldBeEqualToString("rows[3].innerHTML", "3"); |
| </script> |
| <script src="../../../resources/js-test-post.js"></script> |
| </body> |
| </html> |