Re: elements with presentational content

Are you saying the following would result in a button with no label, despite the rendered text?

<div role="button" aria-leaf="true">
  This text is not exposed to APIs. Use an explicit aria-label?
</div>

On May 28, 2014, at 8:27 AM, Alexander Surkov <surkov.alexander@gmail.com> wrote:

> Hi. Lately I run into examples of widgets having presentational content as part of their implementation and that content is exposed to AT which is unfortunate. For example a custom button
> 
> <div role="button">
>   Presentational content
> </div>
> 
> UAIG guide suggests [1] to exclude the content from the tree under certain elements aka "Children of objects which have the characteristic "Children Presentational: True":". It's not clear with me what "Children Presentational" is and that's the first issue. The second one the requirement prevents the author to create menu buttons like:
> 
> <div role="button">Button
>   <div role="button">menu button</div>
> </div>
> 
> (check out XUL example [2]).
> 
> So the trick the author could do is to apply aria-hidden="true" on some internal container
> <div role="button">
>   <div aria-hidden="true">
>     Presentational content
>   </div>
> </div>
> 
> Regardless the author have to introduce extra element in the hierarchy what is not nice, this approach requires all browsers get agreed on aria-hidden implementation.
> 
> Would it be good to introduce new attribute to let the author cut off the content, for example
> <div role="button" aria-leaf="true">
> 
> and can be defined as the browser should not expose any children for element having aria-leaf="true" if the content serves the presentational propose (like not focusable, not operable).
> 
> Alternative names: aria-nocontent, aria-nokids.
> 
> Would it be worth to have an extra attribute for that?
> 
> Thanks.
> Alexander.
> 
> [1] http://www.w3.org/WAI/PF/aria-implementation/#exclude_elements2
> [2] https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/PopupGuide/MenuButtons#The_%27menu-button%27_button

Received on Wednesday, 28 May 2014 20:41:09 UTC