Closed solipet closed 2 months ago
Some more data points:
The ARIA spec discourages the use of redundant ARIA attributes:
It is NOT RECOMMENDED for authors to set the ARIA role and
aria-*
attributes to values that match the implicit ARIA semantics defined in either table.
Source: https://w3c.github.io/html-aria/#rules-wd
aria-required
is the implicit semantics associated with the required
attribute:
Any element where the
required
attribute is allowed:input required
,textarea required
, andselect required
[...]aria-required="true"
Authors SHOULD NOT use the
aria-required="true"
on any element which also has arequired
attribute.
Source: https://w3c.github.io/html-aria/#docconformance-attr
Real-world support for required
in screen readers is largely equivalent between required
and aria-required
:
Excluding Android browsers paired with TalkBack, all other tested screen reader and browser pairings announce a form control as “required” when using the
required
attribute. [...] (Unfortunately, even usingaria-required="true"
on a form control did not help TalkBack announce it as “required.”)
Source: https://www.tpgi.com/required-attribute-requirements/
Additional source for support in conveying the property:
required
: https://a11ysupport.io/tech/html/required_attribute#support-table-0aria-required
: https://a11ysupport.io/tech/aria/aria-required_attribute#support-table-1Blog posts from around 2012 seem to indicate that it was previously recommended due to lack of consistent support at the time, which (along with the mention of IE9 in #781) could explain why the doubling-up was reasonable at the time.
Environment
Current behavior
This form:
produces this output:
Having both
required="required"
andaria-required="true"
is redundant and not recommended per the Mozilla docs.Expected behavior
Ideally, the generated field would look like this:
We see that this behavior was added intentionally in #781 (2013), but is no longer recommended.