diff options
Diffstat (limited to 'LayoutTests/fast/dom/HTMLTableRowElement')
6 files changed, 152 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/HTMLTableRowElement/cells-expected.txt b/LayoutTests/fast/dom/HTMLTableRowElement/cells-expected.txt new file mode 100644 index 0000000..162ed69 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLTableRowElement/cells-expected.txt @@ -0,0 +1,37 @@ +Test behavior of the HTMLTableRowElement cells attribute in cases where there is unusual nesting. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS checkCellNesting("col") is 0 +PASS checkCellNesting("colgroup") is 0 +PASS checkCellNesting("div") is 0 +PASS checkCellNesting("form") is 0 +PASS checkCellNesting("script") is 0 +PASS checkCellNesting("table") is 0 +PASS checkCellNesting("tbody") is 0 +PASS checkCellNesting("tfoot") is 0 +PASS checkCellNesting("thead") is 0 +PASS checkCellNesting("tr") is 0 + +PASS checkCellNesting("td") is 1 +PASS checkCellNesting("th") is 1 + +PASS checkHeaderCellNesting("col") is 0 +PASS checkHeaderCellNesting("colgroup") is 0 +PASS checkHeaderCellNesting("div") is 0 +PASS checkHeaderCellNesting("form") is 0 +PASS checkHeaderCellNesting("script") is 0 +PASS checkHeaderCellNesting("table") is 0 +PASS checkHeaderCellNesting("tbody") is 0 +PASS checkHeaderCellNesting("tfoot") is 0 +PASS checkHeaderCellNesting("thead") is 0 +PASS checkHeaderCellNesting("tr") is 0 + +PASS checkHeaderCellNesting("td") is 1 +PASS checkHeaderCellNesting("th") is 1 + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/dom/HTMLTableRowElement/cells.html b/LayoutTests/fast/dom/HTMLTableRowElement/cells.html new file mode 100644 index 0000000..9a6a573 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLTableRowElement/cells.html @@ -0,0 +1,13 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<link rel="stylesheet" href="../../js/resources/js-test-style.css"> +<script src="../../js/resources/js-test-pre.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="script-tests/cells.js"></script> +<script src="../../js/resources/js-test-post.js"></script> +</body> +</html> diff --git a/LayoutTests/fast/dom/HTMLTableRowElement/insertCell-expected.txt b/LayoutTests/fast/dom/HTMLTableRowElement/insertCell-expected.txt new file mode 100644 index 0000000..114f982 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLTableRowElement/insertCell-expected.txt @@ -0,0 +1,5 @@ +This tests a particular case of insertCell that was crashing on ebay at the time the test was written. + +cell inside table inside cell 0 cell inside table inside cell 1 + +If there was no crash, and you can see text above mentioning cell 1 as well as cell 0, the test passed. diff --git a/LayoutTests/fast/dom/HTMLTableRowElement/insertCell.html b/LayoutTests/fast/dom/HTMLTableRowElement/insertCell.html new file mode 100644 index 0000000..04b79a5 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLTableRowElement/insertCell.html @@ -0,0 +1,28 @@ +<html> + +<head> +<script type="text/javascript"> + +function test() +{ + if (window.layoutTestController) + layoutTestController.dumpAsText(); + var tr = document.getElementById('row'); + tr.insertCell(0).innerHTML = "<td>cell inside table inside cell 0</td>"; + tr.insertCell(1).innerHTML = "<td>cell inside table inside cell 1</td>"; +} + +</script> +</head> + +<body onload="test()"> + +<p>This tests a particular case of insertCell that was crashing on ebay at the time the test was written.</p> + +<p><table><tr id="row"></tr></table></p> + +<p>If there was no crash, and you can see text above mentioning cell 1 as well as cell 0, the test passed.</p> + +</body> + +</html> diff --git a/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/TEMPLATE.html new file mode 100644 index 0000000..1951c43 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/TEMPLATE.html @@ -0,0 +1,13 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<link rel="stylesheet" href="../../js/resources/js-test-style.css"> +<script src="../../js/resources/js-test-pre.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="YOUR_JS_FILE_HERE"></script> +<script src="../../js/resources/js-test-post.js"></script> +</body> +</html> diff --git a/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/cells.js b/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/cells.js new file mode 100644 index 0000000..eb8f7c8 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/cells.js @@ -0,0 +1,56 @@ +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(''); + +var successfullyParsed = true; |