/* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; /* import-globals-from ../../mochitest/role.js */ loadScripts({ name: "role.js", dir: MOCHITESTS_DIR }); /** * Verify that rows and cells retain their native roles when inside thead, * tbody and tfoot with an explicit rowgroup role, nested in a table which has * an explicit ARIA role="table". */ addAccessibleTask( `
a
b
c
`, async function testAriaRowgroup(browser, docAcc) { const table = findAccessibleChildByID(docAcc, "table"); testAccessibleTree(table, { TABLE: [ { ROWGROUP: [{ ROW: [{ COLUMNHEADER: [{ TEXT_LEAF: [] }] }] }], }, { ROWGROUP: [{ ROW: [{ CELL: [{ TEXT_LEAF: [] }] }] }] }, { ROWGROUP: [{ ROW: [{ CELL: [{ TEXT_LEAF: [] }] }] }] }, ], }); }, { chrome: true, topLevel: true } ); /** * Verify that rows and cells retain their native roles when inside a tbody * with an explicit rowgroup role, nested in a table without an explicit ARIA * role. */ addAccessibleTask( `
a
`, async function testAriaRowgroupNativeTable(browser, docAcc) { const table = findAccessibleChildByID(docAcc, "table"); testAccessibleTree(table, { TABLE: [{ ROWGROUP: [{ ROW: [{ CELL: [{ TEXT_LEAF: [] }] }] }] }], }); }, { chrome: true, topLevel: true } ); /** * Verify that rows and cells don't expose their native roles when inside a * tbody with an explicit rowgroup role in a table with role="none". */ addAccessibleTask( `
a
`, async function testAriaRowgroupNoneTable(browser, docAcc) { const rowgroup = findAccessibleChildByID(docAcc, "rowgroup"); testAccessibleTree(rowgroup, { ROWGROUP: [{ TEXT_CONTAINER: [{ TEXT_LEAF: [] }] }], }); }, { chrome: true, topLevel: true } ); /** * Verify that rows and cells don't expose their native roles when inside a * tbody with an explicit rowgroup role, nested in a table with a non-table role. */ addAccessibleTask( `
a
`, async function testAriaRowgroupListTable(browser, docAcc) { const table = findAccessibleChildByID(docAcc, "table"); testAccessibleTree(table, { LIST: [ { ROWGROUP: [ { TEXT_CONTAINER: [{ TEXT_CONTAINER: [{ TEXT_LEAF: [] }] }] }, ], }, ], }); }, { chrome: true, topLevel: true } );