<rdar://problem/6227690> There are a bunch of tables on this page that don't seem...
[WebKit-https.git] / LayoutTests / accessibility / table-detection.html
1 <html>
2 <script>
3     if (window.layoutTestController)
4         layoutTestController.dumpAsText();
5 </script>
6 <body id="body">
7
8     This should be a table because it has a thead
9     <table border=0>
10     <thead><tr><td>asdf</td><td>asdf</td></tr></thead>
11     <tr><td>asdf</td><td>asdf</td></tr>
12     </table>
13
14     This should be a table because cells have borders
15     <table border=1>
16     <tr><td >asdf</td><td>asdf</td></tr>
17     </table>
18
19     This should not be a table because it's cells do not have borders
20     <table style='border: 1px solid black'>
21     <tr><td >asdf</td><td>asdf</td></tr>
22     </table>
23
24     // This should be a table because a cell has a special attribute
25     <table border=0 cellpadding=0>
26     <tr><td abbr="abbr tag">asdf</td><td>asdf</td></tr>
27     </table>
28
29     // This should be a table because a cell has a special attribute
30     <table border=0 cellpadding=0>
31     <tr><td axis="abbr tag">asdf</td><td>asdf</td></tr>
32     </table>
33
34     // This should be a table because a cell has a special attribute
35     <table border=0 cellpadding=0>
36     <tr><td id="test">asdf</td><td>asdf</td></tr>
37     <tr><td headers="test">asdf</td><td>asdf</td></tr>
38     </table>
39
40     // This should be a table because cells have different colors
41     <table border=0 cellpadding=0>
42     <tr><td bgcolor="red">asdf</td><td bgcolor="blue">asdf</td></tr>
43     </table>
44
45     // This should not be a table because cells have different but no spacing
46     <table border=0 cellpadding=0 cellspacing=0>
47     <tr><td style="background-color: red;">asdf</td><td style="background-color: blue;">asdf</td></tr>
48     </table>
49
50     // This should not be a table because cells have the same  colors even though there is spacing
51     <table border=0 cellpadding=0 bgcolor="green" cellspacing=3>
52     <tr><td style="background-color: green;">asdf</td><td style="background-color: green;">asdf</td></tr>
53     </table>
54
55     // this should be a table because it has the "rules" attr
56     <table rules="cols" border=0 cellpadding=0>
57     <tr><td>asdf</td><td>asdf</td></tr>
58     </table>
59
60     // this should not be a table because it only has one valid cell (need more than one)
61     <style type="text/css">
62     .appPol_080915_Lehman_Contributions {  } .labelPol_080915_Lehman_Contributions { undefined } .hedPol_080915_Lehman_Contributions { font-size: 19px; font-family:arial; font-weight:bold;color:#26386b;border-top:1px solid #a4abc1;border-left:1px solid #a4abc1;border-right:1px solid #a4abc1;font-family: Arial, Helvetica, sans-serif; font-size: 100%;font-weight:bold;padding-left:4px;width:90%;height:25px; } .deckPol_080915_Lehman_Contributions { color:#666;font-weight:bold; font-family:verdana; font-size:11px;padding:5px 9px; } .subhedPol_080915_Lehman_Contributions { font-weight:bold;text-decoration:none;text-transform:uppercase;padding:3px 3px; } .colhdrPol_080915_Lehman_Contributions { color:ffffff; font-size:10px;font-weight:bold;background-color:999999; } .font1Pol_080915_Lehman_Contributions { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 70%; line-height: 140%; } .boxB_Pol_080915_Lehman_Contributions { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 70%; line-height: 140%;;border-left:1px #a4abc1 solid;border-bottom:1px #a4abc1 solid;border-right:1px #a4abc1 solid;  ;width:100%; } .headlinePol_080915_Lehman_Contributions { font-weight:bold; } .headlinePol_080915_Lehman_Contributions:hover { } .headlinePol_080915_Lehman_Contributions:visited { font-weight:bold;} .captionPol_080915_Lehman_Contributions { undefined} #NoBg { background-color:transparent; } .navlinkPol_080915_Lehman_Contributions {  color:000000;font-size: 10px;font-family:verdana;line-height: 130%;text-decoration:none; } .navlinkPol_080915_Lehman_Contributions:hover { color:cc3333; } .navlinkPol_080915_Lehman_Contributions:active { color:#cc0000; } .navCellPol_080915_Lehman_Contributions { width:20px;text-align:center;background-color:#EEEEEE;border-left:1px #CCCCCC solid;border-top:1px #CCCCCC solid;padding:2px;cursor:hand;width:100%; } .bulletPol_080915_Lehman_Contributions { color:CC0000;font-family:verdana;font-size:11px;font-weight:bold;color:cc3333; }
63     </style>
64     <table width=100% cellspacing=0 cellpadding=0>
65     <tr>
66     <td nowrap="1" class="labelPol_080915_Lehman_Contributions">
67     <td nowrap="1" class="hedPol_080915_Lehman_Contributions">Contributions</td>
68     </tr></table>
69
70
71     // this should not be a table because it does not have enough cell borders or background colors
72     <style type="text/css">
73     .nmIS,.nmISH{padding-left:20px;padding-right:12px;cursor:pointer;}
74     .nmIP{padding-left:20px;padding-right:12px;font:60% Tahoma,sans-serif;color:#CC0000}
75     .nmIB,.nmIBH,.nmIBD,.nmIBDH,.nmIK,.nmIKH,.nmIKD,.nmIKDH{padding-left:12px;padding-right:12px;cursor:pointer;}
76     .nmIS,.nmISH,.nmIP{border-bottom:1px solid #CCCCCC}
77     .nmIS,.nmIBH,.nmIBDH,.nmIKH,.nmIP{background-color:#EEEEEE}
78     .nmIKD,.nmIKDH{background-color:#CC0000}
79     .nmISH,.nmIB,.nmIBD,.nmIK{background-color:white}
80     .nmLS,.nmLSH,.nmLB,.nmLBH,.nmLBD,.nmLBDH,.nmLK,.nmLKH,.nmLKD,.nmLKDH{font:70% Tahoma,sans-serif}
81     .nmLS,.nmLSH,.nmLBD,.nmLBDH,.nmLKD,.nmLKDH,.nmIP{font-weight:bold}
82     .nmLK,.nmLK:visited,.nmLKH,.nmLKH:visited{color:black;text-decoration:none}
83     .nmLS,.nmLS:visited,.nmLS:hover,.nmLS:active,.nmLSH,.nmLSH:visited,.nmLSH:hover,.nmLSH:active,.nmLB,.nmLB:visited,.nmLBH,.nmLBH:visited,.nmLBD,.nmLBD:visited,.nmLBD:hover,.nmLBD:active,.nmLBDH,.nmLBDH:visited,.nmLBDH:hover,.nmLBDH:active{color:black !important;text-decoration:none}
84     .nmLB:hover,.nmLBH:hover,nmLK:hover,.nmLKH:hover{color:#CC0000;text-decoration:underline}
85     .nmLB:active,.nmLBH:active,.nmLK:active,.nmLKH:active{color:#CC0000;text-decoration:none}
86     .nmLKD,.nmLKD:visited,.nmLKD:hover,.nmLKD:active,.nmLKDH,.nmLKDH:visited,.nmLKDH:hover,.nmLKDH:active{color:white;text-decoration:none}
87     .nmLKD:visited:hover,.nmLKDH:visited:hover{text-decoration:underline;color:white;}
88     .nmTB{border-top:1px solid #CCCCCC;border-left:1px solid #CCCCCC;border-bottom:1px solid #CCCCCC}
89     .nmTK{border-left:3px solid #CC0000;border-bottom:3px solid #CC0000}
90     .nmX{position:absolute;z-index: 100000000;left:0;top:0;height:0;line-height:0px}
91     .nmTB,.nmTK{margin-bottom:2px}
92     .nmTB,.nmTK,.nmTS{text-align:left;}
93     .nmTS {width: 130px;}
94     .nmTB {width: 130px; margin: 0px !important; border-left: 0px; border-top: 0px;}
95     .nmTB{margin-top:12px}
96     .nmCM{padding-top:2px;display:block;height:20px;}
97     .nmCM:visited:hover{text-decoration:none;color:#000000;}
98     </style>
99     <table class="nmTB" cellpadding="0" cellspacing="0"><tr><td class="nmIBD" id="nmb" name="nmb" nm_sn="3032552" nm_suf="" CM_sf="Ex" CM="NewsMenuL1" pn="newsmenu" ct="nm0" cn="Politics"><a class="nmLBD" href="/id/3032553">Politics</a></td></tr><tr><td class="nmIB" id="nmb" name="nmb" nm_sn="18970411" nm_suf="" CM_sf="Ex" CM="NewsMenuL1" pn="newsmenu" ct="nxf" cn="Decision '08"><a class="nmLB" href="/id/18970417">Decision '08</a></td></tr><tr><td class="nmIB" id="nmb" name="nmb" nm_sn="18296896" nm_suf="" CM_sf="Ex" CM="NewsMenuL1" pn="newsmenu" ct="nxf" cn="The debates"><a class="nmLB" href="/id/18296908">The debates</a></td></tr><tr><td class="nmIB" id="nmb" name="nmb" nm_sn="21491043" nm_suf="" CM_sf="Ex" CM="NewsMenuL1" pn="newsmenu" ct="nxf" cn="The White House"><a class="nmLB" href="/id/21672863">The White House</a></td></tr><tr><td class="nmIB" id="nmb" name="nmb" nm_sn="21491571" nm_suf="" CM_sf="Ex" CM="NewsMenuL1" pn="newsmenu" ct="nxf" cn="Capitol Hill"><a class="nmLB" href="/id/21672985">Capitol Hill</a></td></tr><tr><td class="nmIB" id="nmb" name="nmb" nm_sn="14016004" nm_suf="" CM_sf="Ex" CM="NewsMenuL1" pn="newsmenu" ct="nxf" cn="National Journal"><a class="nmLB" href="/id/14016001">National Journal</a></td></tr><tr><td class="nmIB" id="nmb" name="nmb" nm_sn="19748467" nm_suf="" CM_sf="Ex" CM="NewsMenuL1" pn="newsmenu" ct="nxf" cn="New York Times"><a class="nmLB" href="/id/19747577">New York Times</a></td></tr></table>
100
101     <div id="result"></div>
102     
103     <script>
104         if (window.accessibilityController) {
105             var body = document.getElementById("body");
106             body.focus();
107             var table = accessibilityController.focusedElement;
108             
109             result.innerText += "--------------------------\n\n"; 
110             result.innerText += table.attributesOfChildren() + "\n\n"; 
111             result.innerText += "--------------------------\n\n"; 
112         }
113     </script>
114 </body>
115 </html>