aria-labelledby and recursion

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.

Received on Wednesday, 29 April 2015 18:44:33 UTC