accessible/tests/mochitest/tree/test_aria_menu.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <!DOCTYPE html>
michael@0 2 <html>
michael@0 3 <head>
michael@0 4 <title>Test accessible tree when ARIA role menuitem is used</title>
michael@0 5 <link rel="stylesheet" type="text/css"
michael@0 6 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
michael@0 7
michael@0 8 <script type="application/javascript"
michael@0 9 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 10
michael@0 11 <script type="application/javascript"
michael@0 12 src="../common.js"></script>
michael@0 13 <script type="application/javascript"
michael@0 14 src="../role.js"></script>
michael@0 15
michael@0 16 <script type="application/javascript">
michael@0 17 function doTest()
michael@0 18 {
michael@0 19 // Menuitem with no popup.
michael@0 20 tree =
michael@0 21 { SECTION: [ // container
michael@0 22 { MENUPOPUP: [ // menu
michael@0 23 { MENUITEM: [
michael@0 24 { STATICTEXT: [] }, // bullet
michael@0 25 { TEXT_LEAF: [] }
michael@0 26 ] }
michael@0 27 ] }
michael@0 28 ] }
michael@0 29 testAccessibleTree("menu", tree);
michael@0 30
michael@0 31 // Menuitem with explicit no popup.
michael@0 32 tree =
michael@0 33 { SECTION: [ // container
michael@0 34 { MENUPOPUP: [ // menu
michael@0 35 { MENUITEM: [
michael@0 36 { STATICTEXT: [] }, // bullet
michael@0 37 { TEXT_LEAF: [] }
michael@0 38 ] }
michael@0 39 ] }
michael@0 40 ] }
michael@0 41 testAccessibleTree("menu_nopopup", tree);
michael@0 42
michael@0 43 // Menuitem with popup.
michael@0 44 tree =
michael@0 45 { SECTION: [ // container
michael@0 46 { MENUPOPUP: [ // menu
michael@0 47 { PARENT_MENUITEM: [ // menuitem with aria-haspopup="true"
michael@0 48 { STATICTEXT: [] }, // bullet
michael@0 49 { TEXT_LEAF: [] }
michael@0 50 ] }
michael@0 51 ] }
michael@0 52 ] }
michael@0 53 testAccessibleTree("menu_popup", tree);
michael@0 54
michael@0 55 SimpleTest.finish();
michael@0 56 }
michael@0 57
michael@0 58 SimpleTest.waitForExplicitFinish();
michael@0 59 addA11yLoadEvent(doTest);
michael@0 60 </script>
michael@0 61 </head>
michael@0 62 <body>
michael@0 63
michael@0 64 <a target="_blank"
michael@0 65 href="https://bugzilla.mozilla.org/show_bug.cgi?id=786566"
michael@0 66 title="ARIA menuitem acting as submenu should have PARENT_MENUITEM role">
michael@0 67 Mozilla Bug 786566
michael@0 68 </a>
michael@0 69 <p id="display"></p>
michael@0 70 <div id="content" style="display: none"></div>
michael@0 71 <pre id="test">
michael@0 72 </pre>
michael@0 73
michael@0 74 <div id="menu">
michael@0 75 <ul role="menu">
michael@0 76 <li role="menuitem">Normal Menu</li>
michael@0 77 </ul>
michael@0 78 </div>
michael@0 79
michael@0 80 <div id="menu_nopopup">
michael@0 81 <ul role="menu">
michael@0 82 <li role="menuitem" aria-haspopup="false">Menu with explicit no popup</li>
michael@0 83 </ul>
michael@0 84 </div>
michael@0 85
michael@0 86 <div id="menu_popup">
michael@0 87 <ul role="menu">
michael@0 88 <li role="menuitem" aria-haspopup="true">Menu with popup</li>
michael@0 89 </ul>
michael@0 90 </div>
michael@0 91
michael@0 92 </body>
michael@0 93 </html>

mercurial