W3C home > Mailing lists > Public > public-pfwg@w3.org > April 2015

aria-labelledby and recursion

From: Dominic Mazzoni <dmazzoni@google.com>
Date: Wed, 29 Apr 2015 11:44:06 -0700
Message-ID: <CAFz-FYy2rrLppzZEP_YsDZ27cHOdBn8mDnrwnMos_Q+e2o1X5w@mail.gmail.com>
To: "W3C WAI Protocols & Formats" <public-pfwg@w3.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:45:36 UTC