RE: aria-labelledby - chaining vs nesting

Hi Matt,
This is a weird edge case, so I don't think the AccName prototype is right with this one.

Technically your question has two different answers depending on the markup.

Basically, there is a hard rule that no chaining is allowed, no matter what.

Your example though is a bit misleading, because the aria-labelledby reference on the H1 element is a process failure, so the H1 is treated as though it had no aria-labelledby at all because the span it points to is blank, and it's not allowed to follow the second aria-labelledby reference, regardless if the second aria-labelledby reference points to a span with content.

So, in accordance with the AccName process, failing the presence of a valid aria-labelledby or aria-label on the root node, then the child nodes are processed as name from content.

Since the aria-labelledby reference that is set as a child is technically the first valid use of this attribute within the process, then it should then return the name from the ID referenced element at that point. However, if the second span referenced by id="other-span" also included an aria-labelledby reference, it would not be followed.

At present there is a bug in the AccName Prototype where it is not recognizing this step-through process, so I will need to change that soon.

Does this make sense?

All the best,
Bryan







Bryan Garaventa
Principal Accessibility Architect
Level Access, Inc.
Bryan.Garaventa@LevelAccess.com
415.624.2709 (o)
www.LevelAccess.com<http://www.levelaccess.com/>

From: Matt King <a11ythinker@gmail.com>
Sent: Tuesday, June 04, 2019 2:20 PM
To: public-aria-practices@w3.org
Subject: aria-labelledby - chaining vs nesting

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Bryan,

You previously wrote:

1.           The aria-labelledby referrals can only be followed once, and not on any subsequent elements if encountered there such as by chaining aria-labelledby attributes together on different elements. Only the first will be followed and no others.
2.           You cannot nest aria-labelledby references, where you have aria-labelledby on the root node as well as on a child node of the root node. In this last case, only the root node will be traversed and none of the child nodes will be parsed.

Since child nodes are only processed if the root node supports name from content, and since aria-labelledby overrides name from content, the only way I can see that a child node with aria-labelledby could be part of the calculation is by chaining, e.g.:

<h1 aria-labelledby="child-span"><span id="child-span" aria-labelledby="other-span"></span></h1>

In this case, the aria-labelledby attributes are chained as well as nested.
Is there a scenario where you could have nesting without chaining?

I'm just trying to determine if we need warnings against both in the guidance, or if it is sufficient to explain that chaining is prohibited.

Thanks

Received on Monday, 10 June 2019 05:21:01 UTC