Re: Link labels

Sarah,
Yes, most of the time, the link text will be the label of the link (and will pass Label in Name).

However, think about this:
<link aria-label=”banana”>Apple</link>

The value of the displayed text “Apple” is override by aria-lable to be “Banana”. So, the name of the link, Banana, no longer matches, and therefore fails the requirement that “the name<https://www.w3.org/WAI/WCAG21/Understanding/label-in-name.html#dfn-name> contains the text that is presented visually.”

For your question of why this requirement exists, and how it differs from the various other criteria you cite, looking at the In Brief material in https://www.w3.org/WAI/WCAG22/Understanding/label-in-name.htmldocument may help

Goal
The visual label for controls is a trigger for speech activation.
What to do
Where practical, make the control’s text label and name match.
Why it's important
People who operate with voice interaction use the visible labels in their commands.

So, Label in Name is specifically to address the needs of sighted users who are reliant on what they see matching what is programmatically set under the covers.

Hope that helps.

Mike


From: Ms J <ms.jflz.woop@gmail.com>
Date: Tuesday, April 9, 2024 at 7:34 AM
To: w3c-wai-ig@w3.org <w3c-wai-ig@w3.org>
Subject: [EXTERNAL] Link labels
Hello Is linktext a 'label' from a wcag pov? Because 'label in name' applies to links, but I've had people (I think in this forum) say that link text isn't a label. My issue is that if you have a button with a label that isn't programmatically
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
<https://us-phishalarm-ewt.proofpoint.com/EWT/v1/AdhS1Rd-!-_f6_Nhy3g87VfrXzuWg0bk2MEu2OFtU-9_jON-Zz7MRQyr6SwnXizYYVqi-3fIbPgEW03RtZpEzUx8YMHyOswH8GJYhxwTPv-qSYAS7xFQYAvNkCxQv3DjONPs0M8K0P_bK4M_6bwRIrEQ$>
Report Suspicious <https://us-phishalarm-ewt.proofpoint.com/EWT/v1/AdhS1Rd-!-_f6_Nhy3g87VfrXzuWg0bk2MEu2OFtU-9_jON-Zz7MRQyr6SwnXizYYVqi-3fIbPgEW03RtZpEzUx8YMHyOswH8GJYhxwTPv-qSYAS7xFQYAvNkCxQv3DjONPs0M8K0P_bK4M_6bwRIrEQ$>


ZjQcmQRYFpfptBannerEnd
Hello

Is linktext a 'label' from a wcag pov? Because 'label in name' applies to links, but I've had people (I think in this forum) say that link text isn't a label.

My issue is that if you have a button with a label that isn't programmatically associated that would fail 1.3.1 (and 4.1.2 if there is no accessible name, or 2.5.3 if there is an accessible name but it doesn't contain the label string)

But 2.4.4 says text only needs to be part of the 'programmatically determined link context' this extends the idea of 'programmatically associated' so is actually less stringent than 1.3.1. But that means we are less strict with link labels than button labels. Aka
<p>For product information <button> click here </button></p> A 1.3.1 fail?
<p>For product information <button role="link"> click here </button></p> AAA 2.4.9 fail?


And then you have the opposite problem, where labels are not descriptive
<button> click here </button></p> AA 2.4.6 fail? <button role="link"> click here </button> A 2.4.4 fail?

I'm just confused about why there is a separate A fail for links to be honest and wondered if someone could provide some clarity.

Thanks

Sarah

Sent from Outlook for iOS<https://aka.ms/o0ukef>

Received on Tuesday, 9 April 2024 20:05:30 UTC