/* 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"; /** * Verify STATE_READONLY is exposed identically via HTML `readonly` and aria-readonly * for inputs with and without aria roles. */ addAccessibleTask( ` `, async function testReadonlyStates(browser, accDoc) { const comboboxReadonly = findAccessibleChildByID( accDoc, "combobox_readonly" ); const textReadonly = findAccessibleChildByID(accDoc, "text_readonly"); const comboboxAriaReadonly = findAccessibleChildByID( accDoc, "combobox_aria_readonly" ); const comboboxReadonlyAriaFalse = findAccessibleChildByID( accDoc, "combobox_readonly_aria_false" ); const textReadonlyAriaFalse = findAccessibleChildByID( accDoc, "text_readonly_aria_false" ); // Verify readonly on a plain input testStates(textReadonly, STATE_READONLY); // Verify readonly on an input with role=combobox testStates(comboboxReadonly, STATE_READONLY); // Verify aria-readonly on an input with role=combobox testStates(comboboxAriaReadonly, STATE_READONLY); // Per HTML-AAM, when both readonly and aria-readonly are present, only the // readonly attribute value is exposed. aria-readonly="false" should not // remove STATE_READONLY. testStates(comboboxReadonlyAriaFalse, STATE_READONLY); testStates(textReadonlyAriaFalse, STATE_READONLY); } );