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

Unified Diff: LayoutTests/fast/dom/HTMLTableSectionElement/insertRow-skips-non-tr.html

Issue 262163008: HTMLTableSectionElement.insertRow(0) / HTMLTableRowElement.insertCell(0) do not behave correctly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nits 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/HTMLTableSectionElement/insertRow-skips-non-tr.html
diff --git a/LayoutTests/fast/dom/HTMLTableSectionElement/insertRow-skips-non-tr.html b/LayoutTests/fast/dom/HTMLTableSectionElement/insertRow-skips-non-tr.html
new file mode 100644
index 0000000000000000000000000000000000000000..b989a56a5e48f8f02a9041c8c096acaf5d2daccc
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLTableSectionElement/insertRow-skips-non-tr.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="help" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/tabular-data.html#dom-tbody-insertrow">
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+<script>
+description("Tests that HTMLTableSectionElement.insertRow() skips non &lt;tr&gt; children.");
+
+var tb = document.createElement("tbody");
+shouldBe("tb.__proto__", "HTMLTableSectionElement.prototype");
+
+tb.appendChild(new Text("TEXT"));
+tb.appendChild(document.createElement("a"));
+tb.insertRow(-1).innerHTML = "1";
+// The insertRow() method must create a tr element, insert it as a child of the
+// table section element, immediately before the indexth tr element in the rows
+// collection, and finally must return the newly created tr element.
+tb.insertRow(0).innerHTML = "0";
+
+var childNodes = tb.childNodes;
+shouldBe("childNodes.length", "4");
+shouldBeEqualToString("childNodes[0].nodeValue", "TEXT");
+shouldBeEqualToString("childNodes[1].tagName", "A");
+shouldBeEqualToString("childNodes[2].innerHTML", "0");
+shouldBeEqualToString("childNodes[3].innerHTML", "1");
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698