w3c / wcag-act-rules

WCAG Conformance Test Rules
https://wai-wcag-act-rules.netlify.app
Other
19 stars 16 forks source link

Change Fail test case 2 in ACT rule 46ca7f: Element marked as decorative is not exposed - label is exposed in accessibility tree #295

Open philljenkins opened 2 months ago

philljenkins commented 2 months ago

In the ACT test case below the ARIA label does go into the accessibility tree in Chrome and FF, so the accessible name is not empty. Although the developer may be confused because alt="" was added in their source code, perhaps thinking or hoping it would mark the img as decorative, but it wasn't, due to the alt attribute being ignored/overridden by the aria attribute because of the accessible name calculation spec for browsers.

Failed Example 2 Open in a new tab This img element is marked as decorative through its empty alt attribute but has a non-empty aria-labelledby attribute causing it to be included in the accessibility tree with its implicit role of img.

<img src="/test-assets/shared/w3c-logo.png" alt="" aria-labelledby="label" /> 
<span hidden id="label">W3C logo</span>

Perhaps the implementers should report a warning or recommendation notifying the developer of the contradiction.

ACT should clarify why the Failed 2 above is a valid fail test case for ACT ruleID 46ca7f: Element marked as decorative is not exposed - see label (accessible name) results in accessibility tree in browsers

Other references:

IBM Equl Access Accessibility Checker https://github.com/IBMa/equal-access/issues/2013

philljenkins commented 2 months ago

This clause can be revisited and/or clarified:

Implementation of the Presentational Roles Conflict Resolution differs slightly from one user agent to the other. Hence, some elements might be exposed by one user agent and not by another, and consequently might create accessibility issues only for some users. Nevertheless, triggering the conflict is a bad practice.

tombrunet commented 2 months ago

@WilcoFiers The rule notes that this rule is because that some agents don't resolve the role conflict, but Chrome, Firefox, and Safari all recognize this test case as an image. Do you know what user agent doesn't handle this correctly?