2 <?xml-stylesheet href=
"chrome://global/skin" type=
"text/css"?>
3 <?xml-stylesheet href=
"chrome://mochikit/content/tests/SimpleTest/test.css"
6 <window xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
7 title=
"Accessibility Group Attributes ('level', 'setsize', 'posinset') Test.">
9 <script type=
"application/javascript"
10 src=
"chrome://mochikit/content/MochiKit/packed.js"></script>
11 <script type=
"application/javascript"
12 src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
13 <script type=
"application/javascript">
15 var gAccService = null;
17 function accAttributes(aId)
19 this.getAttribute = function getAttribute(aName)
22 return this.mAttrs.getStringProperty(aName);
28 this.mAcc = gAccService.getAccessibleFor(document.getElementById(aId));
29 ok(this.mAcc,
"Can't get accessible for " + aId);
32 this.mAttrs = this.mAcc.attributes;
35 function testGroupAttrs(aID, aPosInSet, aSetSize, aLevel)
37 var attrs = new accAttributes(aID);
38 is(attrs.getAttribute(
"posinset"), aPosInSet,
"Wrong posinset on " + aID);
39 is(attrs.getAttribute(
"setsize"), aSetSize,
"Wrong setsize on " + aID);
41 is(attrs.getAttribute(
"level"), aLevel,
"Wrong level on " + aID);
46 // Activate accessibility, otherwise events aren't fired.
47 gAccService = Components.classes[
"@mozilla.org/accessibleRetrieval;1"].
48 getService(Components.interfaces.nsIAccessibleRetrieval);
50 //////////////////////////////////////////////////////////////////////////
51 // xul:listbox (bug
417317)
52 testGroupAttrs(
"item1",
"1",
"2");
53 testGroupAttrs(
"item2",
"2",
"2");
55 //////////////////////////////////////////////////////////////////////////
56 // xul:menu (bug
443881)
57 var menu1 = document.getElementById(
"menu_item1");
60 window.setTimeout(function() {
61 var menu2 = document.getElementById(
"menu_item2");
64 window.setTimeout(function() {
65 testGroupAttrs(
"menu_item1.1",
"1",
"1");
66 testGroupAttrs(
"menu_item1.2",
"1",
"3");
67 testGroupAttrs(
"menu_item1.4",
"2",
"3");
68 testGroupAttrs(
"menu_item2",
"3",
"3");
69 testGroupAttrs(
"menu_item2.1",
"1",
"2",
"1");
70 testGroupAttrs(
"menu_item2.2",
"2",
"2",
"1");
76 //////////////////////////////////////////////////////////////////////////
77 // ARIA menu (bug
441888)
78 testGroupAttrs(
"aria-menuitem",
"1",
"3");
79 testGroupAttrs(
"aria-menuitemcheckbox",
"2",
"3");
80 testGroupAttrs(
"aria-menuitemradio",
"3",
"3");
81 testGroupAttrs(
"aria-menuitem2",
"1",
"1");
84 SimpleTest.waitForExplicitFinish();
89 <body xmlns=
"http://www.w3.org/1999/xhtml">
91 href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=417317"
92 title=
"Certain types of LISTITEM accessibles no longer get attributes set like 'x of y', regression from fix for bug 389926">
96 href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=443881"
97 title=
"take into account separators in xul menus when group attributes are calculating">
101 href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=441888"
102 title=
"ARIA checked menu items are not included in the total list of menu items">
107 <div id=
"content" style=
"display: none">
114 <listitem label=
"item1" id=
"item1"/>
115 <listitem label=
"item2" id=
"item2"/>
119 <menu label=
"item1" id=
"menu_item1">
121 <menuitem label=
"item1.1" id=
"menu_item1.1"/>
123 <menuitem label=
"item1.2" id=
"menu_item1.2"/>
124 <menuitem label=
"item1.3" hidden=
"true"/>
125 <menuitem label=
"item1.4" id=
"menu_item1.4"/>
126 <menu label=
"item2" id=
"menu_item2">
128 <menuitem label=
"item2.1" id=
"menu_item2.1"/>
129 <menuitem label=
"item2.2" id=
"menu_item2.2"/>
137 <description role=
"menuitem" id=
"aria-menuitem"
138 value=
"conventional menuitem"/>
139 <description role=
"menuitemcheckbox" id=
"aria-menuitemcheckbox"
140 value=
"conventional checkbox menuitem"/>
141 <description role=
"menuitem" hidden=
"true"/>
142 <description role=
"menuitemradio" id=
"aria-menuitemradio"
143 value=
"conventional radio menuitem"/>
144 <description role=
"separator"
145 value=
"conventional separator"/>
146 <description role=
"menuitem" id=
"aria-menuitem2"
147 value=
"conventional menuitem"/>