test_headers_ariatable.html (2696B)
1 <!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en"> 2 <html> 3 <head> 4 <title>Table header information cells for ARIA table</title> 5 <meta http-equiv="content-type" content="text/html; charset=UTF-8"> 6 <link rel="stylesheet" type="text/css" 7 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 8 9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 10 11 <script type="application/javascript" 12 src="../common.js"></script> 13 <script type="application/javascript" 14 src="../table.js"></script> 15 16 <script type="application/javascript"> 17 18 function doTest() { 19 // //////////////////////////////////////////////////////////////////////// 20 // column and row headers from markup 21 22 const headerInfoMap = [ 23 { 24 cell: "table_dc_1", 25 rowHeaderCells: [ "table_rh_1" ], 26 columnHeaderCells: [ "table_ch_2" ], 27 }, 28 { 29 cell: "table_dc_2", 30 rowHeaderCells: [ "table_rh_1" ], 31 columnHeaderCells: [ "table_ch_3" ], 32 }, 33 { 34 cell: "table_dc_3", 35 rowHeaderCells: [ "table_rh_2" ], 36 columnHeaderCells: [ "table_ch_2" ], 37 }, 38 { 39 cell: "table_dc_4", 40 rowHeaderCells: [ "table_rh_2" ], 41 columnHeaderCells: [ "table_ch_3" ], 42 }, 43 { 44 cell: "table_rh_1", 45 rowHeaderCells: [], 46 columnHeaderCells: [ "table_ch_1" ], 47 }, 48 { 49 cell: "table_rh_2", 50 rowHeaderCells: [], 51 columnHeaderCells: [ "table_ch_1" ], 52 }, 53 ]; 54 55 testHeaderCells(headerInfoMap); 56 57 SimpleTest.finish(); 58 } 59 60 SimpleTest.waitForExplicitFinish(); 61 addA11yLoadEvent(doTest); 62 </script> 63 </head> 64 65 <body> 66 <a target="_blank" 67 title="support ARIA table and cell roles" 68 href="https://bugzilla.mozilla.org/show_bug.cgi?id=1173364">Bug 1173364</a> 69 70 <p id="display"></p> 71 <div id="content" style="display: none"></div> 72 <pre id="test"> 73 </pre> 74 75 <div role="table"> 76 <div role="row"> 77 <span id="table_ch_1" role="columnheader">col_1</span> 78 <span id="table_ch_2" role="columnheader">col_2</span> 79 <span id="table_ch_3" role="columnheader">col_3</span> 80 </div> 81 <div role="row"> 82 <span id="table_rh_1" role="rowheader">row_1</span> 83 <span id="table_dc_1" role="cell">cell1</span> 84 <span id="table_dc_2" role="cell">cell2</span> 85 </div> 86 <div role="row"> 87 <span id="table_rh_2" role="rowheader">row_2</span> 88 <span id="table_dc_3" role="cell">cell3</span> 89 <span id="table_dc_4" role="cell">cell4</span> 90 </div> 91 </div> 92 93 </body> 94 </html>