1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/tree/test_aria_presentation.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,122 @@ 1.4 +<!DOCTYPE html> 1.5 +<html> 1.6 +<head> 1.7 + <title>Test accessible tree when ARIA role presentation is used</title> 1.8 + <link rel="stylesheet" type="text/css" 1.9 + href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.10 + 1.11 + <script type="application/javascript" 1.12 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <script type="application/javascript" 1.14 + src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> 1.15 + 1.16 + <script type="application/javascript" 1.17 + src="../common.js"></script> 1.18 + <script type="application/javascript" 1.19 + src="../role.js"></script> 1.20 + 1.21 + <script type="application/javascript"> 1.22 + function doTest() 1.23 + { 1.24 + // Presentation role don't allow accessible. 1.25 + var tree = 1.26 + { SECTION: [ // container 1.27 + { TEXT_LEAF: [ ] } // child text of presentation node 1.28 + ] }; 1.29 + testAccessibleTree("div_cnt", tree); 1.30 + 1.31 + // Focusable element, presentation role is ignored. 1.32 + tree = 1.33 + { SECTION: [ // container 1.34 + { PUSHBUTTON: [ // button 1.35 + { TEXT_LEAF: [ ] } 1.36 + ] } 1.37 + ] }; 1.38 + testAccessibleTree("btn_cnt", tree); 1.39 + 1.40 + // Presentation table, no table structure is exposed. 1.41 + tree = 1.42 + { SECTION: [ // container 1.43 + { TEXT_CONTAINER: [ // td generic accessible 1.44 + { TEXT_LEAF: [ ] } // cell text 1.45 + ] } 1.46 + ] }; 1.47 + testAccessibleTree("tbl_cnt", tree); 1.48 + 1.49 + // Focusable table, presentation role is ignored. 1.50 + tree = 1.51 + { SECTION: [ // container 1.52 + { TABLE: [ // table 1.53 + { ROW: [ // tr 1.54 + { CELL: [ //td 1.55 + { TEXT_LEAF: [ ] } 1.56 + ] } 1.57 + ] } 1.58 + ] } 1.59 + ] }; 1.60 + testAccessibleTree("tblfocusable_cnt", tree); 1.61 + 1.62 + // Has ARIA globals or referred by ARIA relationship. 1.63 + tree = 1.64 + { SECTION: [ // container 1.65 + { LABEL: [ // label, has aria-owns 1.66 + { TEXT_LEAF: [ ] } 1.67 + ] }, 1.68 + { TEXT_LEAF: [ ] }, 1.69 + { LABEL: [ // label, referenced by aria-owns 1.70 + { TEXT_LEAF: [ ] } 1.71 + ] } 1.72 + ] }; 1.73 + testAccessibleTree("airaglobalprop_cnt", tree); 1.74 + 1.75 + SimpleTest.finish(); 1.76 + } 1.77 + 1.78 + SimpleTest.waitForExplicitFinish(); 1.79 + addA11yLoadEvent(doTest); 1.80 + </script> 1.81 +</head> 1.82 +<body> 1.83 + 1.84 + <a target="_blank" 1.85 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=548291" 1.86 + title="Accessible tree of ARIA image maps"> 1.87 + Mozilla Bug 548291 1.88 + </a> 1.89 + <a target="_blank" 1.90 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=666504" 1.91 + title="Ignore role presentation on focusable elements"> 1.92 + Mozilla Bug 666504 1.93 + </a> 1.94 + <p id="display"></p> 1.95 + <div id="content" style="display: none"></div> 1.96 + <pre id="test"> 1.97 + </pre> 1.98 + 1.99 + <div id="div_cnt"><div role="presentation">text</div></div> 1.100 + 1.101 + <div id="btn_cnt"><button role="presentation">btn</button></div> 1.102 + 1.103 + <div id="tbl_cnt"> 1.104 + <table role="presentation"> 1.105 + <tr> 1.106 + <td>cell</td> 1.107 + </tr> 1.108 + </table> 1.109 + </div> 1.110 + 1.111 + <div id="tblfocusable_cnt"> 1.112 + <table role="presentation" tabindex="0"> 1.113 + <tr> 1.114 + <td>cell</td> 1.115 + </tr> 1.116 + </table> 1.117 + </div> 1.118 + 1.119 + <div id="airaglobalprop_cnt"> 1.120 + <label role="presentation" aria-owns="ariaowned">has aria-owns</label> 1.121 + <label role="presentation" id="ariaowned">referred by aria-owns</label> 1.122 + </div> 1.123 + 1.124 +</body> 1.125 +</html>