Open Bug 1505974 Opened 10 months ago Updated 6 months ago

Text of element with role="alert" not included in description when referenced by aria-describedby

Categories

(Core :: Disability Access APIs, defect, P3)

defect

Tracking

()

People

(Reporter: Jamie, Unassigned)

References

(Blocks 1 open bug)

Details

STR:
1. Open this test case:
data:text/html,<input type="text" aria-describedby="alert"><div id="alert" role="alert">Error</div>
2. Right click the input and select Inspect Accessibility Properties.
3. Check the description property.
Expected: description: "Error"
Actual: description: ""

If you remove role="alert", it works as expected.

Originally reported as an NVDA issue: https://github.com/nvaccess/nvda/issues/8929
This is because some div with role="alert" gets its text contents added as a description, not as the name. According to the WAI-ARIA 1.1 spec, this is correct behavior, as role="alert" requires name only from author, which means aria-label or aria-labelledby. See https://www.w3.org/TR/wai-aria-1.1/#alert.

The description is not looked at when collecting text from aria-describedby references, and neither is the sub tree for role="alert".

Step 2F of accname-1.1 states "Otherwise, if the current node's role allows name from content, or if the current node is referenced by aria-labelledby, aria-describedby, or is a native host language text alternative element (e.g. label in HTML), or is a descendant of a native host language text alternative element..."

The key is "Or if the current node is referenced by aria-labelledby, aria-describedby..."

Therefore I read that to mean that this issue is valid. Yes, role="alert" will get its accessible name from the author, but when it doesn't have a name from the author and is referenced via aria-describedby, its contents must be returned.

Is my understanding correct?

I tested several different screen reader / browser combinations. JAWS supports this pattern, while others do not, so clarification would be helpful. Details are at https://a11ysupport.io/tests/tech__aria__aria_describedby_with_role_alert

You need to log in before you can comment on or make changes to this bug.