AW: ARIA Problem

Hi Bryan,

Thanks a lot for your complete explenation of the listbox role. We use it now for years in our products exactly as you describe it.

My only question was the problem of empty listboxes:

*         According to the ARIA Spec 5.2.5: Required owned elements<http://www.w3.org/TR/wai-aria/complete#mustContain>, an element with a role defining one or more requred owned elements must own at least one element with such a role.

*         Listbox role defines "option" as a required owned role.

*         What is then the validation result of an element with a listbox role which does not own any option role element?

*         And, if fortunately such a valitation is OK, where should we set the focus in case of an empty list - also to the element with the role listbox directly?

Thanks in advance!
Mario


Von: Bryan Garaventa [mailto:bryan.garaventa@whatsock.com]
Gesendet: Mittwoch, 25. November 2015 02:07
An: Batusic, Mario <mario.batusic@fabasoft.com>; w3c-wai-ig@w3.org
Betreff: RE: ARIA Problem

Hi,
The Listbox role is analogous to a standard HTML select element, and as such does support being empty if nothing is currently contained within it.

The role mappings when an Option is present however, require that selectable Option nodes be children of the Listbox container, whether as embedded children or mapped explicitly using aria-owns if not.

In practice, the most reliable usage presently is to make sure that Option nodes are embedded within the same container though.

Then you can set focus to the role=listbox container and use the arrow keys to change selection and update aria-activedescendant accordingly to point to the ID of each selected role=option element, or use roving tabindex to set focus to each role=option element individually using the arrow keys to change focus between them.

The aria-selected attribute is used to specify which role=option element is selected within the Listbox.

It's also important to assign an explicit label for the role=listbox container, in the same way that you would label a form field. This can be done using aria-label or aria-labelledby. Supplementary descriptions can be assigned using aria-describedby too if applicable. This is true regardless if the Listbox is empty of Options or not.

If it's helpful, I've mapped out the role and attribute hierarchies for Listbox at
http://whatsock.com/training/matrices/#listbox

As opposed to a structural construct such as List, at
http://whatsock.com/training/matrices/#list
Which is directly analogous to an HTML ul element.

It's important for people not to get the two of these confused.

Does this help?

All the best,
Bryan


From: Batusic, Mario [mailto:mario.batusic@fabasoft.com]
Sent: Tuesday, November 24, 2015 3:02 AM
To: w3c-wai-ig@w3.org
Subject: ARIA Problem

Dear ARIA Specialists,

I have a fundamental problem with ARIA (also not yet better in ARIA 1.1):
An element with role=listbox requres at least one descendant with role=option. But I have to implement a selectable list (listbox) that very often can be empty. The HTML solves this for static lists allowing for <ul>-elements to be without contents.

Is there some other possibility to solve the empty list problem without optimizing the definition for the listbox role?
Thanks in advance!

Ciao     Mario

Received on Wednesday, 25 November 2015 07:34:32 UTC