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

Unified Diff: LayoutTests/fast/dom/HTMLTableRowElement/insertCell-default-argument.html

Issue 263323004: HTMLTableRowElement.insertCell()'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
Index: LayoutTests/fast/dom/HTMLTableRowElement/insertCell-default-argument.html
diff --git a/LayoutTests/fast/dom/HTMLTableRowElement/insertCell-default-argument.html b/LayoutTests/fast/dom/HTMLTableRowElement/insertCell-default-argument.html
new file mode 100644
index 0000000000000000000000000000000000000000..6809483db6a2a27392f3e8ba97c20c7e199e2205
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTableRowElement/insertCell-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#the-tr-element">
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+<script>
+description("Tests that HTMLTableRowElement.insertCell()'s default argument is -1.");
+
+var tr = document.createElement("tr");
+shouldBe("tr.__proto__", "HTMLTableRowElement.prototype");
+
+tr.insertCell().innerHTML = "1"; // Should append.
+tr.insertCell().innerHTML = "2"; // Should append.
+tr.insertCell(-1).innerHTML = "3"; // Should append.
+tr.insertCell(0).innerHTML = "0"; // Should prepend.
+
+var cells = tr.cells;
+shouldBe("cells.length", "4");
+shouldBeEqualToString("cells[0].innerHTML", "0");
+shouldBeEqualToString("cells[1].innerHTML", "1");
+shouldBeEqualToString("cells[2].innerHTML", "2");
+shouldBeEqualToString("cells[3].innerHTML", "3");
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698