Re: Does the HTML5 required attribute have the same accessibility affect as aria-required for an ARIA defined widget?

(+Steve for the bug reference which I reopened.)

On May 8, 2014, at 9:19 AM, Gunderson, Jon R <jongund@illinois.edu> wrote:

> For pages created using  HTML5 markup should the HTML5 required attribute be used instead of aria-required for ARIA widgets?

No. @required is only allowed on native HTML5 form elements like <input>, <select>, etc. It will not and should not work on custom ARIA controls like gridcells or even custom ARIA controls that have native equivalents.

These (incomplete) examples are both required.

  1. <input type="checkbox" required>
  2. <div role="checkbox" aria-required="true"></div>

These examples are both invalid and not required

  3. <div role="checkbox" required></div>
  4. <input type="checkbox" aria-required="true">

Example #3 is invalid and not required because there is no html:@required attribute on html:div.

Example #4 is invalid and not required because there *is* an html:@required attribute available on html:input, so the lack of this boolean attribute means the element is not required. The explicit ARIA attribute aria-required="true" is in direct conflict with this value, so the host language attribute should win. See HTML bug #23376. https://www.w3.org/Bugs/Public/show_bug.cgi?id=23376

James


On May 8, 2014, at 9:19 AM, Gunderson, Jon R <jongund@illinois.edu> wrote:

> For pages created using  HTML5 markup should the HTML5 required attribute be used instead of aria-required for ARIA widgets?
>  
> For example the following example of a required gridcell:
>  
> Using  HTML5 required attribute:
>  
> <div role=”grid”>
>   <div role=”row”>
>     <div role=”gridcell” required></div>
>   </div>
> </div>
>  
> Using ARAI aria-required:
>  
> <div role=”grid”>
>   <div role=”row”>
>     <div role=”gridcell” aria-required=”true”></div>
>   </div>
> </div>
>  
> Jon

Received on Thursday, 8 May 2014 16:46:25 UTC