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

Gunderson, Jon R 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>

Hi Jon,

About 2 years ago I did some resarch on @required vs. @aria-required
(http://john.foliot.ca/required-inputs/), and at that time the user-agents
were applying some additional visual sytling when @required was "submitted"
but not satisfied. I'm not sure what would happen in your gridcell example
(why is a gridcell "required"?), but according to the API mapping, both
should be equivelant when reporting to screen readers.

Question, can the @required attribute even be applied to a <div>?

- http://www.w3.org/TR/html-aapi/ suggests to me that it can only be applied
to <input>, <select>, and <textarea>

-
http://www.w3.org/TR/2011/WD-html5-20110525/common-input-element-attributes.
html suggests to me that HTML5 only allows @required on input elements:

  "These attributes only apply to an input element if its type attribute is
in a state whose definition declares that the attribute applies. --> When an
attribute doesn't apply to an input element, user agents must ignore the
attribute, regardless of the requirements and definitions below. <--

- Finally, when attemptiong to run that code against the W3C Validator, I
got the following error message:

	" Attribute required not allowed on element div at this point.

    <div role=”gridcell” required></div>

Based on all of the above, I would say no, do not use the HTML5 @required
attribute.

HTH

JF

Received on Thursday, 8 May 2014 17:00:39 UTC