Bug 706134 - ARIA listitem shouldn't expose selectable state and pick up aria-selected and aria-checked, r=surkov
authorAndrzej Skalski <askalski@mozilla.com>
Sat, 11 Feb 2012 03:25:48 +0900
changeset 86626 f9cbe927b103576b5b5123d7af3e5cb9814fe39d
parent 86625 053d3cc103cbbf026e9f4c575d4454d9e9a31eb6
child 86627 83e4a240abc0735e37d9fb6cbf442720a3e93f66
push idunknown
push userunknown
push dateunknown
reviewerssurkov
bugs706134
milestone13.0a1
Bug 706134 - ARIA listitem shouldn't expose selectable state and pick up aria-selected and aria-checked, r=surkov
accessible/src/base/nsARIAMap.cpp
accessible/tests/mochitest/focus/test_takeFocus.html
accessible/tests/mochitest/selectable/test_aria.html
accessible/tests/mochitest/test_aria_token_attrs.html
--- a/accessible/src/base/nsARIAMap.cpp
+++ b/accessible/src/base/nsARIAMap.cpp
@@ -230,18 +230,17 @@ nsRoleMapEntry nsARIAMap::gWAIRoleMap[] 
   },
   {
     "list",
     roles::LIST,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
-    states::READONLY,
-    eARIAMultiSelectable
+    states::READONLY
   },
   {
     "listbox",
     roles::LISTBOX,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
@@ -251,19 +250,17 @@ nsRoleMapEntry nsARIAMap::gWAIRoleMap[] 
   },
   {
     "listitem",
     roles::LISTITEM,
     kUseMapRole,
     eNoValue,
     eNoAction, // XXX: should depend on state, parent accessible
     eNoLiveAttr,
-    states::READONLY,
-    eARIASelectable,
-    eARIACheckedMixed
+    states::READONLY
   },
   {
     "log",
     roles::NOTHING,
     kUseNativeRole,
     eNoValue,
     eNoAction,
     ePoliteLiveAttr,
--- a/accessible/tests/mochitest/focus/test_takeFocus.html
+++ b/accessible/tests/mochitest/focus/test_takeFocus.html
@@ -91,19 +91,19 @@
   </pre>
 
   <span id="aria-link" role="link" tabindex="0">link</span>
   <span id="aria-link2" role="link" tabindex="0">link</span>
 
   <a id="link" href="">link</span>
 
   <div role="listbox" aria-activedescendant="item1" id="container" tabindex="1">
-    <div role="listitem" id="item1">item1</div>
-    <div role="listitem" id="item2">item2</div>
-    <div role="listitem" id="item3">item3</div>
+    <div role="option" id="item1">item1</div>
+    <div role="option" id="item2">item2</div>
+    <div role="option" id="item3">item3</div>
   </div>
 
   <embed id="plugin" type="application/x-test" width="200" height="200" wmode="window"></embed>
 
   <select id="listbox" size="5">
     <option id="lb_item1">item1</option>
     <option id="lb_item2">item2</option>
   </select>
--- a/accessible/tests/mochitest/selectable/test_aria.html
+++ b/accessible/tests/mochitest/selectable/test_aria.html
@@ -32,35 +32,16 @@
 
       acc.clearSelection();
       testSelectableSelection(acc, []);
     }
 
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
-      // role="list"
-
-      var id = "list1";
-      ok(isAccessible(id, [nsIAccessibleSelectable]),
-         "No selectable accessible for " + id);
-
-      testSelectableSelection(id, [ ]);
-
-      var select = getAccessible(id, [nsIAccessibleSelectable]);
-      select.addChildToSelection(0);
-      testSelectableSelection(id, [ ]);
-      select.removeChildFromSelection(0);
-      testSelectableSelection(id, [ ]);
-      select.selectAllSelection();
-      testSelectableSelection(id, [ ]);
-      select.clearSelection();
-      testSelectableSelection(id, [ ]);
-
-      //////////////////////////////////////////////////////////////////////////
       // role="listbox"
 
       id = "listbox1";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
       testSelectableSelection(id, [ ]);
 
@@ -77,17 +58,17 @@
       select.addChildToSelection(0);
       testSelectableSelection(id, [ "listbox2_item1" ]);
       select.removeChildFromSelection(0);
       testSelectableSelection(id, [ ]);
       select.selectAllSelection();
       testSelectableSelection(id, [ "listbox2_item1", "listbox2_item2" ]);
       select.clearSelection();
       testSelectableSelection(id, [ ]);
-
+      
       //////////////////////////////////////////////////////////////////////////
       // role="grid"
 
       id = "grid1";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
       testSelectableSelection(id, [ ]);
@@ -147,29 +128,24 @@
      title="add pseudo SelectAccessible interface">
     Mozilla Bug 590176
   </a><br>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
-  <div role="list" id="list1">
-    <div role="listitem">item1</div>
-    <div role="listitem">item2</div>
-  </div>
-
   <div role="listbox" id="listbox1">
-    <div role="listitem">item1</div>
-    <div role="listitem">item2</div>
+    <div role="option">item1</div>
+    <div role="option">item2</div>
   </div>
 
   <div role="listbox" id="listbox2" aria-multiselectable="true">
-    <div role="listitem" id="listbox2_item1">item1</div>
-    <div role="listitem" id="listbox2_item2">item2</div>
+    <div role="option" id="listbox2_item1">item1</div>
+    <div role="option" id="listbox2_item2">item2</div>
   </div>
 
   <div role="grid" id="grid1">
     <div role="row">
       <span role="gridcell">cell</span>
       <span role="gridcell">cell</span>
     </div>
     <div role="row">
--- a/accessible/tests/mochitest/test_aria_token_attrs.html
+++ b/accessible/tests/mochitest/test_aria_token_attrs.html
@@ -84,22 +84,22 @@ https://bugzilla.mozilla.org/show_bug.cg
 
       // test (listbox) multiselectable states
       testStates("listbox_multiselectable_true", STATE_MULTISELECTABLE | STATE_EXTSELECTABLE);
       testStates("listbox_multiselectable_false", 0, 0, STATE_MULTISELECTABLE | STATE_EXTSELECTABLE);
       testStates("listbox_multiselectable_empty", 0, 0, STATE_MULTISELECTABLE | STATE_EXTSELECTABLE);
       testStates("listbox_multiselectable_undefined", 0, 0, STATE_MULTISELECTABLE | STATE_EXTSELECTABLE);
       testStates("listbox_multiselectable_absent", 0, 0, STATE_MULTISELECTABLE | STATE_EXTSELECTABLE);
 
-      // test (listitem) checkable and checked states
-      testStates("listitem_checked_true", (STATE_CHECKABLE | STATE_CHECKED));
-      testStates("listitem_checked_false", STATE_CHECKABLE, 0, STATE_CHECKED);
-      testStates("listitem_checked_empty", 0 , 0, STATE_CHECKABLE | STATE_CHECKED);
-      testStates("listitem_checked_undefined", 0, 0, STATE_CHECKABLE | STATE_CHECKED);
-      testStates("listitem_checked_absent", 0, 0, STATE_CHECKABLE | STATE_CHECKED);
+      // test (option) checkable and checked states
+      testStates("option_checked_true", (STATE_CHECKABLE | STATE_CHECKED));
+      testStates("option_checked_false", STATE_CHECKABLE, 0, STATE_CHECKED);
+      testStates("option_checked_empty", 0 , 0, STATE_CHECKABLE | STATE_CHECKED);
+      testStates("option_checked_undefined", 0, 0, STATE_CHECKABLE | STATE_CHECKED);
+      testStates("option_checked_absent", 0, 0, STATE_CHECKABLE | STATE_CHECKED);
 
       // test (menuitem) checkable and checked states
       testStates("menuitem_checked_true", (STATE_CHECKABLE | STATE_CHECKED));
       testStates("menuitem_checked_false", STATE_CHECKABLE, 0, STATE_CHECKED);
       testStates("menuitem_checked_empty", 0, 0, (STATE_CHECKABLE | STATE_CHECKED));
       testStates("menuitem_checked_undefined", 0, 0, (STATE_CHECKABLE | STATE_CHECKED));
       testStates("menuitem_checked_absent", 0, 0, (STATE_CHECKABLE | STATE_CHECKED));
 
@@ -234,29 +234,29 @@ https://bugzilla.mozilla.org/show_bug.cg
 
   <div id="checkbox_disabled_true" role="checkbox" aria-disabled="true" tabindex="0">This checkbox has aria-disabled="true" and should get STATE_DISABLED.</div>
   <div id="checkbox_disabled_false" role="checkbox" aria-disabled="false">This checkbox has aria-disabled="false" and should <emph>not</emph> get STATE_DISABLED.</div>
   <div id="checkbox_disabled_empty" role="checkbox" aria-disabled="">This checkbox has aria-disabled="" and should <emph>not</emph> get STATE_DISABLED.</div>
   <div id="checkbox_disabled_undefined" role="checkbox" aria-disabled="undefined">This checkbox has aria-disabled="undefined" and should <emph>not</emph> get STATE_DISABLED.</div>
   <div id="checkbox_disabled_absent" role="checkbox">This checkbox has <emph>no</emph> aria-disabled attribute and should <emph>not</emph> get STATE_DISABLED.</div>
 
   <div id="listbox_multiselectable_true" role="listbox" aria-multiselectable="true">
-    <div id="listitem_checked_true" role="listitem" aria-checked="true">item</div>
+    <div id="option_checked_true" role="option" aria-checked="true">item</div>
   </div>
   <div id="listbox_multiselectable_false" role="listbox" aria-multiselectable="false">
-    <div id="listitem_checked_false" role="listitem" aria-checked="false">item</div>
+    <div id="option_checked_false" role="option" aria-checked="false">item</div>
   </div>
   <div id="listbox_multiselectable_empty" role="listbox" aria-multiselectable="">
-    <div id="listitem_checked_empty" role="listitem" aria-checked="">item</div>
+    <div id="option_checked_empty" role="option" aria-checked="">item</div>
   </div>
   <div id="listbox_multiselectable_undefined" role="listbox" aria-multiselectable="undefined">
-    <div id="listitem_checked_undefined" role="listitem" aria-checked="undefined">item</div>
+    <div id="option_checked_undefined" role="option" aria-checked="undefined">item</div>
   </div>
   <div id="listbox_multiselectable_absent" role="listbox">
-    <div id="listitem_checked_absent" role="listitem">item</div>
+    <div id="option_checked_absent" role="option">item</div>
   </div>
 
   <div role="menu">
     <div id="menuitem_checked_true" role="menuitem" aria-checked="true">This menuitem has aria-checked="true" and should get STATE_CHECKABLE. It should also get STATE_checked.</div>
     <div id="menuitem_checked_false" role="menuitem" aria-checked="false">This menuitem has aria-checked="false" and should get STATE_CHECKABLE.</div>
     <div id="menuitem_checked_empty" role="menuitem" aria-checked="">This menuitem has aria-checked="" and should <emph>not</emph> get STATE_CHECKABLE.</div>
     <div id="menuitem_checked_undefined" role="menuitem" aria-checked="undefined">This menuitem has aria-checked="undefined" and should <emph>not</emph> get STATE_CHECKABLE.</div>
     <div id="menuitem_checked_absent" role="menuitem">This menuitem has <emph>no</emph> aria-checked attribute and should <emph>not</emph> get STATE_CHECKABLE.</div>