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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/rows.js

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 10 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 description('Test behavior of the HTMLTableElement rows attribute in cases where there is unusual nesting.');
2
3 function checkNoBodyRowNesting(tag)
4 {
5 var table = document.createElement("table");
6 var container = document.createElement(tag);
7 var row = document.createElement("tr");
8 table.appendChild(container);
9 container.appendChild(row);
10 return table.rows.length;
11 }
12
13 function checkRowNesting(tag)
14 {
15 var table = document.createElement("table");
16 var body = document.createElement("tbody");
17 var container = document.createElement(tag);
18 var row = document.createElement("tr");
19 table.appendChild(body);
20 body.appendChild(container);
21 container.appendChild(row);
22 return table.rows.length;
23 }
24
25 var sectionTags = [
26 "tbody",
27 "tfoot",
28 "thead",
29 ];
30
31 var otherTags = [
32 "col",
33 "colgroup",
34 "div",
35 "form",
36 "script",
37 "table",
38 "td",
39 "th",
40 ];
41
42 for (i = 0; i < otherTags.length; ++i)
43 shouldBe('checkRowNesting("' + otherTags[i] + '")', '0');
44
45 debug('');
46
47 for (i = 0; i < sectionTags.length; ++i)
48 shouldBe('checkRowNesting("' + sectionTags[i] + '")', '0');
49
50 debug('');
51
52 shouldBe('checkRowNesting("tr")', '1');
53
54 debug('');
55
56 for (i = 0; i < otherTags.length; ++i)
57 shouldBe('checkNoBodyRowNesting("' + otherTags[i] + '")', '0');
58
59 debug('');
60
61 for (i = 0; i < sectionTags.length; ++i)
62 shouldBe('checkNoBodyRowNesting("' + sectionTags[i] + '")', '1');
63
64 debug('');
65
66 shouldBe('checkNoBodyRowNesting("tr")', '1');
67
68 debug('');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698