This is a paragraph inside the article.
/* 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/role.js */ loadScripts({ name: "role.js", dir: MOCHITESTS_DIR }); /** * Test ARIA role map */ addAccessibleTask( `
This is a paragraph inside the article.
This is a paragraph inside the article.
Table based log |
Table based log |
hi |
hi |
hi |
hi |
hi |
hi |
hi |
hi |
hi |
hi |
hi |
hi |
hi |
hi |
cell |
cell |
foo |
foo |
Image:
Image:
Text: x2 + y2 + z2
Text: x2 + y2 + z2
`, async function testRoleQuirks(browser, accDoc) { let getAcc = id => findAccessibleChildByID(accDoc, id); // Test equation image testRole(getAcc("img_eq"), ROLE_FLAT_EQUATION); testRole(getAcc("img_eq_mixed"), ROLE_FLAT_EQUATION); // Test textual equation testRole(getAcc("txt_eq"), ROLE_FLAT_EQUATION); testRole(getAcc("txt_eq_mixed"), ROLE_FLAT_EQUATION); }, { chrome: true, topLevel: true } ); /** * Test doc role changes */ addAccessibleTask( ``, async function testRoleQuirks(browser, accDoc) { await invokeSetAttribute(browser, "body", "role", "application"); await untilCacheIs( () => accDoc.role, ROLE_APPLICATION, "Doc role is 'application'" ); await invokeSetAttribute(browser, "body", "role", "dialog"); await untilCacheIs(() => accDoc.role, ROLE_DIALOG, "Doc role is 'dialog'"); // Other roles aren't valid on body elements. await invokeSetAttribute(browser, "body", "role", "document"); await untilCacheIs( () => accDoc.role, ROLE_DOCUMENT, "Doc role is 'document'" ); await invokeSetAttribute(browser, "body", "role", "button"); await untilCacheIs( () => accDoc.role, ROLE_DOCUMENT, "Doc role is 'document'" ); // ... but mixed roles should still function like their regular variants await invokeSetAttribute(browser, "body", "role", "ApPLiCaTiOn"); await untilCacheIs( () => accDoc.role, ROLE_APPLICATION, "Doc role is 'application'" ); await invokeSetAttribute(browser, "body", "role", "dIaLoG"); await untilCacheIs(() => accDoc.role, ROLE_DIALOG, "Doc role is 'dialog'"); }, { chrome: true, topLevel: true } ); /** * Test re-parented list item's role gets recomputed. */ addAccessibleTask( `