Bug 1480060: Support aria-multiselectable on role tablist. r=MarcoZ
authorJames Teh <jteh@mozilla.com>
Mon, 13 Aug 2018 06:28:35 +0000
changeset 486271 179fc264c8643d1f8770ef2b2e861abf56a5287e
parent 486270 50e4f06ac01a1f6dc187ef6ea23226e551f6f2a0
child 486272 d05ea252346c6cca1b9148b315b9bc5678b6fd19
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMarcoZ
bugs1480060
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1480060: Support aria-multiselectable on role tablist. r=MarcoZ Differential Revision: https://phabricator.services.mozilla.com/D3076
accessible/base/ARIAMap.cpp
accessible/tests/mochitest/selectable/test_aria.html
accessible/tests/mochitest/states/test_aria.html
--- a/accessible/base/ARIAMap.cpp
+++ b/accessible/base/ARIAMap.cpp
@@ -1128,17 +1128,18 @@ static const nsRoleMapEntry sWAIRoleMaps
     &nsGkAtoms::tablist,
     roles::PAGETABLIST,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     eSelect,
     states::HORIZONTAL,
-    eARIAOrientation
+    eARIAOrientation,
+    eARIAMultiSelectable
   },
   { // tabpanel
     &nsGkAtoms::tabpanel,
     roles::PROPERTYPAGE,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
--- a/accessible/tests/mochitest/selectable/test_aria.html
+++ b/accessible/tests/mochitest/selectable/test_aria.html
@@ -32,23 +32,42 @@
       acc.unselectAll();
       testSelectableSelection(acc, []);
     }
 
     function doTest() {
       // ////////////////////////////////////////////////////////////////////////
       // role="tablist"
 
-      id = "tablist";
+      id = "tablist_single";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
       testSelectableSelection(id, [ ]);
 
       // ////////////////////////////////////////////////////////////////////////
+      // role="tablist" aria-multiselectable
+
+      id = "tablist_multi";
+      ok(isAccessible(id, [nsIAccessibleSelectable]),
+         "No selectable accessible for " + id);
+
+      testSelectableSelection(id, [ ]);
+
+      select = getAccessible(id, [nsIAccessibleSelectable]);
+      select.addItemToSelection(0);
+      testSelectableSelection(id, [ "tab_multi1" ]);
+      select.removeItemFromSelection(0);
+      testSelectableSelection(id, [ ]);
+      select.selectAll();
+      testSelectableSelection(id, [ "tab_multi1", "tab_multi2" ]);
+      select.unselectAll();
+      testSelectableSelection(id, [ ]);
+
+      // ////////////////////////////////////////////////////////////////////////
       // role="listbox"
 
       id = "listbox1";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
       testSelectableSelection(id, [ ]);
 
@@ -140,21 +159,26 @@
      title="Selection event not fired when selection of ARIA tab changes">
     Mozilla Bug 804040
   </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
-  <div role="tablist" id="tablist">
+  <div role="tablist" id="tablist_single">
     <div role="tab">tab1</div>
     <div role="tab">tab2</div>
   </div>
 
+  <div role="tablist" id="tablist_multi" aria-multiselectable="true">
+    <div role="tab" id="tab_multi1">tab1</div>
+    <div role="tab" id="tab_multi2">tab2</div>
+  </div>
+
   <div role="listbox" id="listbox1">
     <div role="option">item1</div>
     <div role="option">item2</div>
   </div>
 
   <div role="listbox" id="listbox2" aria-multiselectable="true">
     <div role="option" id="listbox2_item1">item1</div>
     <div role="option" id="listbox2_item2">item2</div>
--- a/accessible/tests/mochitest/states/test_aria.html
+++ b/accessible/tests/mochitest/states/test_aria.html
@@ -103,16 +103,18 @@
       testStates("aria_modal_false", 0, 0, 0, EXT_STATE_MODAL);
 
       // aria-multiline
       testStates("aria_multiline_textbox", 0, EXT_STATE_MULTI_LINE);
 
       // aria-multiselectable
       testStates("aria_multiselectable_listbox",
                  STATE_MULTISELECTABLE | STATE_EXTSELECTABLE);
+      testStates("aria_multiselectable_tablist",
+                 STATE_MULTISELECTABLE | STATE_EXTSELECTABLE);
 
       // aria-pressed
       testStates("aria_pressed_button", STATE_PRESSED, 0, STATE_CHECKABLE);
       testStates("aria_pressed_native_button", STATE_PRESSED, 0, STATE_CHECKABLE);
 
       // aria-readonly
       testStates("aria_readonly_textbox", STATE_READONLY);
 
@@ -412,16 +414,17 @@
   <div id="aria_mixed_switch" role="switch" aria-checked="mixed">
     I am unsupported
   </div>
 
   <div id="aria_modal" aria-modal="true">modal stuff</div>
   <div id="aria_modal_false" aria-modal="false">non modal stuff</div>div>
   <div id="aria_multiline_textbox" role="textbox" aria-multiline="true"></div>
   <div id="aria_multiselectable_listbox" role="listbox" aria-multiselectable="true"></div>
+  <div id="aria_multiselectable_tablist" role="tablist" aria-multiselectable="true"></div>
   <div id="aria_pressed_button" role="button" aria-pressed="true">Button</div>
   <button id="aria_pressed_native_button" aria-pressed="true">Button</button>
 
   <div id="aria_readonly_textbox"
        role="textbox" aria-readonly="true">This text should be readonly</div>
 
   <div id="aria_grid_default" role="grid">
     <div role="row">