summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/rows.js
blob: 80ac6a340fbe91c91fc027ea49d8254b3ea50073 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
description('Test behavior of the HTMLTableSectionElement rows attribute in cases where there is unusual nesting.');

function checkRowNesting(tag)
{
    var body = document.createElement("tbody");
    var container = document.createElement(tag);
    var row = document.createElement("tr");
    body.appendChild(container);
    container.appendChild(row);
    return body.rows.length;
}

var sectionTags = [
    "tbody",
    "tfoot",
    "thead",
];

var otherTags = [
    "col",
    "colgroup",
    "div",
    "form",
    "script",
    "table",
    "td",
    "th",
];

for (i = 0; i < otherTags.length; ++i)
    shouldBe('checkRowNesting("' + otherTags[i] + '")', '0');

debug('');

for (i = 0; i < sectionTags.length; ++i)
    shouldBe('checkRowNesting("' + sectionTags[i] + '")', '0');

debug('');

shouldBe('checkRowNesting("tr")', '1');

debug('');

var successfullyParsed = true;