Re: aria-labelledby and recursion

My reading has always been that you only don't follow the 
aria-labelledby traversal when the referenced node itself includes 
aria-labelledby, so for your first example the label for the input would 
be "Label 1" and for your 2nd it would be "Enter your Visa or Mastercard 
credit card number now".

I guess if this is causing confusion the language needs to be tidied up 
- perhaps even with some more examples.

Regards,
James

On 4/29/2015 11:44 AM, Dominic Mazzoni wrote:
> Is aria-labelledby supposed to be allowed to be used recursively? For 
> example:
>
> <input aria-labelledby="label1">
> <div id="label1" aria-labelledby="label2">Label 1</div>
> <div id="label2">Label 2</div>
>
> Is the computed name of the input element supposed to be Label 1 or 
> Label 2? I thought it was supposed to be Label 2, but the spec 
> (http://www.w3.org/TR/accname-aam-1.1/) says:
>
> "Otherwise, if the current node has a non-empty aria-labelledby 
> attribute, and the current node is not already part of an 
> aria-labelledby traversal, process its IDREFs in the order they occur:"
>
> That seems to imply that when you're part of an aria-labelledby 
> traversal, you stop following the aria-labelledby attribute. Is that 
> true, or is it misworded?
>
> Here's an even more subtle example:
>
> <input aria-labelledby="label1">
> <div id="label1">
>   Enter your
>     <img src="visa.png" aria-labelledby="visa">
>   or
>     <img src="mastercard.png" aria-labelledby="mastercard">
>   credit card number now.
> </div>
> <div hidden id="visa">Visa</div>
> <div hidden id="mastercard">Mastercard</div>
>
> I think as a web developer I'd be really surprised if the text for the 
> label element itself was "Enter your visa or mastercard credit card 
> number now" but the computed label for the input element was "Enter 
> your or credit card number now" because aria-labelledby is not allowed 
> to be followed recursively.
>

-- 
Regards, James

Oracle <http://www.oracle.com>
James Nurthen | Principal Engineer, Accessibility
Phone: +1 650 506 6781 <tel:+1%20650%20506%206781> | Mobile: +1 415 987 
1918 <tel:+1%20415%20987%201918> | Video: james.nurthen@oracle.com 
<sip:james.nurthen@oracle.com>
Oracle Corporate Architecture
500 Oracle Parkway | Redwood Cty, CA 94065
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to 
developing practices and products that help protect the environment

Received on Wednesday, 29 April 2015 18:51:40 UTC