dequelabs / axe-core

Accessibility engine for automated Web UI testing
https://www.deque.com/axe/
Mozilla Public License 2.0
5.75k stars 746 forks source link

aria-required-attr should consider fallback values #4481

Open WilcoFiers opened 1 month ago

WilcoFiers commented 1 month ago

In ARIA 1.2 the W3C removed all default values from properties that were set to be required. We updated axe-core accordingly, requiring attributes that had not been before. What we had missed is that after they did this, a table was added which re-introduced these default values as "fallback values" in a separate section of ARIA:

https://www.w3.org/TR/wai-aria-1.3/#document-handling_author-errors_states-properties

The example for which this came up was aria-level on role=heading. This should not fail axe-core. All major screen readers seem to report this as a level 2 heading:

<div role=heading>Hello world</div>

Passing that doesn't seem like an issue. I'm much more concerned about having axe-core pass things like checkboxes without aria-checked, or a combobox without aria-controls or aria-expanded. Those will need more discussion. Looking at how ACT has done this, it has a similar rule which requires these things to be failed. It doesn't require these to be mapped to WCAG though, so if we wanted to stay consistent with ACT perhaps the best thing to do is for us to make this a best practice rule instead.

WilcoFiers commented 1 month ago

This change is going to impact our ACT implementation. We should do something in ACT to ensure they make the same change we make here.