/* 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"; requestLongerTimeout(2); /** * A test specification that has the following format: * [ * attr relevant aria attribute * hostRelation corresponding host relation type * dependantRelation corresponding dependant relation type * ] */ const attrRelationsSpec = [ ["aria-labelledby", RELATION_LABELLED_BY, RELATION_LABEL_FOR], ["aria-describedby", RELATION_DESCRIBED_BY, RELATION_DESCRIPTION_FOR], ["aria-controls", RELATION_CONTROLLER_FOR, RELATION_CONTROLLED_BY], ["aria-flowto", RELATION_FLOWS_TO, RELATION_FLOWS_FROM], ["aria-details", RELATION_DETAILS, RELATION_DETAILS_FOR], ["aria-errormessage", RELATION_ERRORMSG, RELATION_ERRORMSG_FOR], ]; /** * Test caching of relations between accessible objects. */ addAccessibleTask( `
label
label2
`, async function (browser, accDoc) { for (let spec of attrRelationsSpec) { await testRelated(browser, accDoc, ...spec); } }, { iframe: true, remoteIframe: true } ); /** * Test caching of relations with respect to label objects and their "for" attr. */ addAccessibleTask( ` `, async function (browser, accDoc) { await testRelated( browser, accDoc, "for", RELATION_LABEL_FOR, RELATION_LABELLED_BY ); }, { iframe: true, remoteIframe: true } ); /** * Test rel caching for element with existing relation attribute. */ addAccessibleTask( `
label