Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification of *when* a role="alert" should be announced by AT / fire an alert event #2153

Open
patrickhlauke opened this issue Apr 2, 2024 · 4 comments

Comments

@patrickhlauke
Copy link
Member

patrickhlauke commented Apr 2, 2024

Describe your concern

Currently, in the description for role="alert" it states

Alerts are assertive live regions, which means they cause immediate notification for assistive technology users. If the operating system allows, the user agent SHOULD fire a system alert event through the accessibility API when the WAI-ARIA alert is created.

The "when the WAI-ARIA alert is created" part is handwavy and vague.

Currently (even though this is not really specified well either - more on this in a separate issue I'll be filing) with live regions, the most reliable way to trigger a live region correctly is to make sure that the live region element/container is "seen" by the browser first, giving AT a chance to then register for the events that are fired when the region's content changes. only then, you'd want to populate the live region element (by dynamically injecting content, or by flipping the visibility of a node inside it, or similar). So, based on the first sentence ("Alerts are assertive live regions"), you'd assume that role="alert" elements have the same behaviour.

However, it appears that in most browser/screen reader combinations, role="alert" is treated slightly magically/special: it seems to trigger an actual SR announcement even if the node is created already fully populated with content. Usually, it even fires an alert notification when the fully populated role="alert" element is present in the markup of the page on first page load.

The ARIA spec shies away from defining the expected behavior here. Cross-checking Core-AAM https://www.w3.org/TR/core-aam-1.2/#role-map-alert there's a note https://www.w3.org/TR/core-aam-1.2/#ftn.note2 that actually sidesteps the question completely at this point

This specification does not currently contain guidance for when user agents should fire system alert events. Some guidance may be added to the specification at a later date but it will be a recommendation (SHOULD), not a requirement (MUST).

I would strongly urge for "some guidance" to be added both in the ARIA spec, and a matching note in the Core-AAM spec.

Link to the version of the specification or documentation you were looking at at.

Link to documentation: https://www.w3.org/TR/wai-aria-1.3/#alert

Does the issue exists in the editors draft (the editors draft is the most recent draft of the specification)? Yes

@patrickhlauke
Copy link
Member Author

/cc @scottaohara

@patrickhlauke
Copy link
Member Author

related #2144

@spectranaut
Copy link
Contributor

This was discussed in today's meeting, but it turned out to be a big topic and we didn't have quite enough time: https://www.w3.org/2024/04/18-aria-minutes.html#t07

Will have to continue the discussion next week (or in a deep dive?).

@spectranaut spectranaut added Agenda and removed Agenda labels Apr 30, 2024
@spectranaut
Copy link
Contributor

Further discussion here: #2154 (comment)

@spectranaut spectranaut removed the Agenda label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants