/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict"; /* import-globals-from ../../mochitest/selectable.js */ // //////////////////////////////////////////////////////////////////////// // role="tablist" role="listbox" role="grid" role="tree" role="treegrid" addAccessibleTask( `
tab1
tab2
item1
item2
cell cell
cell cell
item1
item1.1
item2
cell cell
cell cell
cell cell
`, async function (browser, docAcc) { info( 'role="tablist" role="listbox" role="grid" role="tree" role="treegrid"' ); testSelectableSelection(findAccessibleChildByID(docAcc, "tablist"), []); testSelectableSelection(findAccessibleChildByID(docAcc, "listbox"), []); testSelectableSelection(findAccessibleChildByID(docAcc, "grid"), []); testSelectableSelection(findAccessibleChildByID(docAcc, "tree"), []); testSelectableSelection(findAccessibleChildByID(docAcc, "treegrid"), []); }, { chrome: true, topLevel: true, iframe: true, remoteIframe: true, } ); // //////////////////////////////////////////////////////////////////////// // role="tablist" aria-multiselectable addAccessibleTask( `
`, async function (browser, docAcc) { info('role="tablist" aria-multiselectable'); let tablist = findAccessibleChildByID(docAcc, "tablist", [ nsIAccessibleSelectable, ]); testSelectableSelection(tablist, ["tab_multi1", "tab_multi3"]); }, { chrome: true, topLevel: true, iframe: true, remoteIframe: true, } ); // //////////////////////////////////////////////////////////////////////// // role="listbox" aria-multiselectable addAccessibleTask( `
item1
item2
item2
`, async function (browser, docAcc) { info('role="listbox" aria-multiselectable'); let listbox = findAccessibleChildByID(docAcc, "listbox", [ nsIAccessibleSelectable, ]); testSelectableSelection(listbox, ["listbox2_item1", "listbox2_item3"]); }, { chrome: true, topLevel: true, iframe: true, remoteIframe: true, } ); // //////////////////////////////////////////////////////////////////////// // role="grid" aria-multiselectable, selectable children in subtree addAccessibleTask( `
Entry # Date Expense
1 03/14/05 Conference Fee
ab
`, async function (browser, docAcc) { info('role="grid" aria-multiselectable, selectable children in subtree'); const grid = findAccessibleChildByID(docAcc, "grid", [ nsIAccessibleSelectable, ]); // grid_cell1 is a with an implicit role of gridcell. testSelectableSelection(grid, ["grid_colhead1", "grid_cell1"]); info("Verify aria-selected doesn't apply to that isn't gridcell"); // We can't use testSelectableSelection here because table (rightly) isn't a // selectable container. const tableB = findAccessibleChildByID(docAcc, "tableB"); testStates(tableB, 0, 0, STATE_SELECTED, 0); }, { chrome: true, topLevel: true, iframe: true, remoteIframe: true, } );