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

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

Issue 2785963002: Move tests for table elements to LayoutTests/html/tabular_data/. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description('Test behavior of the HTMLTableRowElement cells attribute in cases w here there is unusual nesting.');
9
10 function checkCellNesting(tag)
11 {
12 var row = document.createElement("tr");
13 var container = document.createElement(tag);
14 var cell = document.createElement("td");
15 row.appendChild(container);
16 container.appendChild(cell);
17 return row.cells.length;
18 }
19
20 function checkHeaderCellNesting(tag)
21 {
22 var row = document.createElement("tr");
23 var container = document.createElement(tag);
24 var cell = document.createElement("th");
25 row.appendChild(container);
26 container.appendChild(cell);
27 return row.cells.length;
28 }
29
30 var tags = [
31 "col",
32 "colgroup",
33 "div",
34 "form",
35 "script",
36 "table",
37 "tbody",
38 "tfoot",
39 "thead",
40 "tr",
41 ];
42
43 for (i = 0; i < tags.length; ++i)
44 shouldBe('checkCellNesting("' + tags[i] + '")', '0');
45
46 debug('');
47
48 shouldBe('checkCellNesting("td")', '1');
49 shouldBe('checkCellNesting("th")', '1');
50
51 debug('');
52
53 for (i = 0; i < tags.length; ++i)
54 shouldBe('checkHeaderCellNesting("' + tags[i] + '")', '0');
55
56 debug('');
57
58 shouldBe('checkHeaderCellNesting("td")', '1');
59 shouldBe('checkHeaderCellNesting("th")', '1');
60
61 debug('');
62 </script>
63 </body>
64 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698