Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: LayoutTests/fast/dom/HTMLTableElement/insertRow-default-argument.html

Issue 270213007: HTMLTableElement.insertRow()'s argument default value should be -1 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLTableElement/insertRow-default-argument-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/HTMLTableElement/insertRow-default-argument.html
diff --git a/LayoutTests/fast/dom/HTMLTableElement/insertRow-default-argument.html b/LayoutTests/fast/dom/HTMLTableElement/insertRow-default-argument.html
new file mode 100644
index 0000000000000000000000000000000000000000..7b3a90c7bfb5e165bd0301016c8c37a5df97f05c
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTableElement/insertRow-default-argument.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="help" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/tabular-data.html#htmltableelement">
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+<script>
+description("Tests that HTMLTableElement.insertRow()'s default argument is -1.");
+
+var table = document.createElement("table");
+shouldBe("table.__proto__", "HTMLTableElement.prototype");
+
+table.insertRow().innerHTML = "1"; // Should append.
+table.insertRow().innerHTML = "2"; // Should append.
+table.insertRow(-1).innerHTML = "3"; // Should append.
+table.insertRow(0).innerHTML = "0"; // Should prepend.
+
+var rows = table.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>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLTableElement/insertRow-default-argument-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698