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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/cells.html

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 11 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: third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/cells.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/cells.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/cells.html
index 4ef75527068919b1c6bcadd84be2528f69f1f237..ba207ccef013ffa398dc7bded70aaee07b652791 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/cells.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/cells.html
@@ -4,6 +4,61 @@
<script src="../../../resources/js-test.js"></script>
</head>
<body>
-<script src="script-tests/cells.js"></script>
+<script>
+description('Test behavior of the HTMLTableRowElement cells attribute in cases where there is unusual nesting.');
+
+function checkCellNesting(tag)
+{
+ var row = document.createElement("tr");
+ var container = document.createElement(tag);
+ var cell = document.createElement("td");
+ row.appendChild(container);
+ container.appendChild(cell);
+ return row.cells.length;
+}
+
+function checkHeaderCellNesting(tag)
+{
+ var row = document.createElement("tr");
+ var container = document.createElement(tag);
+ var cell = document.createElement("th");
+ row.appendChild(container);
+ container.appendChild(cell);
+ return row.cells.length;
+}
+
+var tags = [
+ "col",
+ "colgroup",
+ "div",
+ "form",
+ "script",
+ "table",
+ "tbody",
+ "tfoot",
+ "thead",
+ "tr",
+];
+
+for (i = 0; i < tags.length; ++i)
+ shouldBe('checkCellNesting("' + tags[i] + '")', '0');
+
+debug('');
+
+shouldBe('checkCellNesting("td")', '1');
+shouldBe('checkCellNesting("th")', '1');
+
+debug('');
+
+for (i = 0; i < tags.length; ++i)
+ shouldBe('checkHeaderCellNesting("' + tags[i] + '")', '0');
+
+debug('');
+
+shouldBe('checkHeaderCellNesting("td")', '1');
+shouldBe('checkHeaderCellNesting("th")', '1');
+
+debug('');
+</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698