[JSC] Int52Rep(DoubleRepAnyIntUse) should not call operation function
[WebKit-https.git] / LayoutTests / accessibility / table-scope.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <script src="../resources/js-test-pre.js"></script>
6 </head>
7 <body id="body">
8
9 <table border="1" cellpadding="5" cellspacing="2" id="table">
10   <tbody><tr>
11     <th colspan="6" scope="colgroup">Community Courses -- Bath Autumn 1997</th>
12   </tr>
13   <tr>
14     <th scope="col" abbr="Name">Course Name</th>
15     <th scope="col" abbr="Tutor">Course Tutor</th>
16     <th scope="col">Summary</th>
17     <th scope="col">Code</th>
18     <th scope="col" colspan="2">Fee</th>
19   </tr>
20   <tr>
21     <td scope="row">After the Civil War</td>
22     <td>Dr. John Wroughton</td>
23     <td>
24        The course will examine the turbulent years in England
25        after 1646. <em>6 weekly meetings starting Monday 13th
26       October.</em>
27     </td>
28     <td>H27</td>
29     <td>£32</td>
30     <td>£32</td>
31   </tr>
32   <tr>
33     <td scope="row">An Introduction to Anglo-Saxon England</td>
34     <td scope="rowgroup" rowspan="2">Mark Cottle</td>
35     <td>
36        One day course introducing the early medieval
37        period reconstruction the Anglo-Saxons and
38        their society. <em>Saturday 18th October.</em>
39     </td>
40     <td>H28</td>
41     <td>£18</td>
42     <td>£18</td>
43   </tr>
44   <tr>
45     <td scope="row">The Glory that was Greece</td>
46     <td>
47      Birthplace of democracy, philosophy, heartland of theater, home of
48      argument. The Romans may have done it but the Greeks did it
49      first. <em>Saturday day school 25th October 1997</em>
50     </td>
51     <td>H30</td>
52     <td>£18</td>
53     <td>£18</td>
54   </tr>
55 </tbody></table>
56
57
58 <p id="description"></p>
59 <div id="console"></div>
60
61 <script>
62
63     description("This tests the scope attribute on table cells will manifest as the right header elements on the cells in that row or column.");
64
65     if (window.accessibilityController) {
66
67         var table = accessibilityController.accessibleElementById("table");
68
69         // Course name has a column header of Community Courses.
70         var cell = table.cellForColumnAndRow(0, 1);
71         var colHeaders = cell.columnHeaders();
72         shouldBeTrue("colHeaders[0].isEqual(table.cellForColumnAndRow(0, 0))");
73
74         // As does Fee.
75         cell = table.cellForColumnAndRow(4, 1);
76         var colHeaders = cell.columnHeaders();
77         shouldBeTrue("colHeaders[0].isEqual(table.cellForColumnAndRow(0, 0))");
78
79         // Dr. John should have two col headers and a row header.
80         cell = table.cellForColumnAndRow(1, 2);
81         colHeaders = cell.columnHeaders();
82         rowHeaders = cell.rowHeaders();
83         shouldBeTrue("colHeaders[0].isEqual(table.cellForColumnAndRow(0, 0))");
84         shouldBeTrue("colHeaders[1].isEqual(table.cellForColumnAndRow(1, 1))");
85         shouldBeTrue("rowHeaders[0].isEqual(table.cellForColumnAndRow(0, 2))");
86
87         // Code H28, two row headers, two col headers.
88         cell = table.cellForColumnAndRow(3, 3);
89         colHeaders = cell.columnHeaders();
90         rowHeaders = cell.rowHeaders();
91         shouldBeTrue("colHeaders[0].isEqual(table.cellForColumnAndRow(0, 0))");
92         shouldBeTrue("colHeaders[1].isEqual(table.cellForColumnAndRow(3, 1))");
93         shouldBeTrue("rowHeaders[0].isEqual(table.cellForColumnAndRow(0, 3))");
94         shouldBeTrue("rowHeaders[1].isEqual(table.cellForColumnAndRow(1, 3))");
95
96         // Verify Code H30 has two row headers even though the 2nd header started in a span before this row.
97         cell = table.cellForColumnAndRow(3, 4);
98         rowHeaders = cell.rowHeaders();
99         shouldBeTrue("rowHeaders[0].isEqual(table.cellForColumnAndRow(0, 4))");
100         shouldBeTrue("rowHeaders[1].isEqual(table.cellForColumnAndRow(1, 3))");
101
102         // Verify items in column 5 are picking up Fee as a header even though it's colspan starts before this column.
103         cell = table.cellForColumnAndRow(4, 4);
104         colHeaders = cell.columnHeaders();
105         shouldBeTrue("colHeaders[0].isEqual(table.cellForColumnAndRow(0, 0))");
106         shouldBeTrue("colHeaders[1].isEqual(table.cellForColumnAndRow(4, 1))");
107
108     }
109
110 </script>
111
112 <script src="../resources/js-test-post.js"></script>
113 </body>
114 </html>