FreedomScientific / standards-support

Contains documentation for Vispero software support of Web standards
https://freedomscientific.github.io/standards-support/
GNU General Public License v3.0
105 stars 11 forks source link

JAWS emits wrong "pressed" attribute for switches on web pages #835

Open Vladimir-Goncharov-a11y opened 1 month ago

Vladimir-Goncharov-a11y commented 1 month ago

Summary

JAWS emits "pressed on" and "off not pressed" instead of "on" and "off" for switches in Virtual PC Cursor mode. Forms mode announces switch states correctly, as "on" and "off".

ARIA definition for the role "switch":. https://www.w3.org/TR/wai-aria-1.1/#switch Switch is “A type of checkbox that represents on/off values, as opposed to checked/unchecked values. See related checkbox. The aria-checked attribute of a switch indicates whether the input is on (true) or off (false).”

Switch example ON ARIA Authoring Practises: https://www.w3.org/WAI/ARIA/apg/patterns/switch/examples/switch/

Use "x" quick navigation key to get the following JAWS transcript: JAWS transcript begins:

Notifications Switch Off Not pressed

End of JAWS transcript.

JAWS has a problem in Virtual PC cursor emitting "pressed" or "not pressed" like it is not a switch but a toggle button.

NVDA correctly follows ARIA, and has the following transcript:

Notifications, switch, Off

Looks like, in JAWS, “pressed” and “not pressed” derived from implicitly assumed aria-pressed attribute. ARIA definition for aria-pressed: https://www.w3.org/TR/wai-aria-1.1/#aria-pressed Aria-pressed “Indicates the current "pressed" state of toggle buttons. … aria-pressed attribute is similar but not identical to the aria-checked attribute. Operating systems support pressed on buttons and checked on checkboxes.”

Thus, aria-pressed applicable for the toggle buttons only. You can check the switch role ARIA definition (link above), for role=switch, you will see there a list of applicable attributes, and aria-pressed is not in the list: this attribute is not applicable for the role switch. You can check ARIA definition for aria-pressed (another link above), to find to which roles aria-pressed can be applied. It is only one role: button, and not the switch.

Could you remove pressed/not pressed from switches, having on/off only?

Expected result

Switches in VPC are Off or On only, and never Pressed or Not pressed.

Actual result

The states of switches in VPC are incorrectly emitted as "pressed on" and "off not pressed".

Examples

This ARIA APG page has 3 page examples with various switches: https://www.w3.org/WAI/ARIA/apg/patterns/switch/ All of them have "on pressed" and "off not pressed" instead of "on" and "off" when "x" quick navigation key is used in Virtual PC Cursor mode.

Additional Information

Reproducible with JAWS default (windows-r, jaws2024 /default, OK button)

When a web page has a mix of toggle buttons and switches, it become really confusing. Pressed/not pressed is for toggle buttons Checked/not checked is for checkboxes On/off is for switches. Do not mix these attributes, please, web interfaces can be complex, and they should be accessible and easy to perceive by blind users.

PS. Toggle buttons and checkboxes works correctly in JAWS. Thank you! PPS. Switches work in Forms mode of JAWS, the bug is for the Virtual PC Cursor mode only. Use "alt-del" to check the current JAWS mode.

JAWS version and build number

JAWS version 2024.2405.48.400

Operating System and version

Microsoft Windows 11 Professional Version 23H2 (OS Build 22631.3447), System Type x64

Browser and version:

Google Chrome Version 124.0.6367.207

JAWS-test commented 1 month ago

Related: https://github.com/FreedomScientific/standards-support/issues/368