Bug 1335734 - Make sure ARIA role 'directory' exposes the READONLY state so it doesn't get treated as a widget, r=surkov
authorMarco Zehe <mzehe@mozilla.com>
Thu, 02 Feb 2017 06:46:00 +0100
changeset 469885 13a04dc6650c414c065b358e1cf7c31af1eb9217
parent 469884 f7b9640e63f0fde3610d7c66652610437fb8f6a2
child 469886 98654213e2473c9aee2984e67c3659d2ebed27c1
push id43881
push userbmo:gps@mozilla.com
push dateThu, 02 Feb 2017 23:49:03 +0000
reviewerssurkov
bugs1335734
milestone54.0a1
Bug 1335734 - Make sure ARIA role 'directory' exposes the READONLY state so it doesn't get treated as a widget, r=surkov MozReview-Commit-ID: 9J90gANe9Ib
accessible/base/ARIAMap.cpp
accessible/tests/mochitest/states/test_aria.html
--- a/accessible/base/ARIAMap.cpp
+++ b/accessible/base/ARIAMap.cpp
@@ -179,17 +179,17 @@ static const nsRoleMapEntry sWAIRoleMaps
   { // directory
     &nsGkAtoms::directory,
     roles::LIST,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eList,
-    kNoReqStates
+    states::READONLY
   },
   { // document
     &nsGkAtoms::document,
     roles::DOCUMENT,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
--- a/accessible/tests/mochitest/states/test_aria.html
+++ b/accessible/tests/mochitest/states/test_aria.html
@@ -174,16 +174,19 @@
                  STATE_READONLY, 0);
       testStates("aria_treegrid_readonly_rowheader_inherited", STATE_READONLY, 0,
                  0, EXT_STATE_EDITABLE);
       testStates("aria_treegrid_readonly_cell_editable", 0, EXT_STATE_EDITABLE,
                  STATE_READONLY, 0);
       testStates("aria_treegrid_readonly_cell_inherited", STATE_READONLY, 0,
                  0, EXT_STATE_EDITABLE);
 
+      // aria-readonly on directory
+      testStates("aria_directory", STATE_READONLY);
+
       // aria-selectable
       testStates("aria_selectable_listitem", STATE_SELECTABLE | STATE_SELECTED);
 
       // active state caused by aria-activedescendant
       testStates("as_item1", 0, EXT_STATE_ACTIVE);
       testStates("as_item2", 0, 0, 0, EXT_STATE_ACTIVE);
 
       // universal ARIA properties inherited from file input control
@@ -620,10 +623,13 @@
     <div role="treeitem">G</div>
     <div role="treeitem">g</div>
   </div>
   <div id="aria_treegrid_disabled" role="treegrid" aria-disabled="true">
     <div role="row"><div role="gridcell">H</div></div>
     <div role="row"><div role="gridcell">h</div></div>
   </div>
 
+  <!-- Test that directory is readonly -->
+  <div id="aria_directory" role="directory"></div>
+
 </body>
 </html>