Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make empty links report 2.4.4 violation #369

Closed
robfentress opened this issue Jun 19, 2017 · 5 comments
Closed

make empty links report 2.4.4 violation #369

robfentress opened this issue Jun 19, 2017 · 5 comments
Labels
feat New feature or enhancement rules Issue or false result from an axe-core rule

Comments

@robfentress
Copy link

Though links that have no text result in a violation of the rule, link-name, "Ensures links have discernible text" the tags associated with this rule do not include wcag244, which, I think, is the most relevant success criterion that is violated. For reference, 2.4.4 is:

2.4.4 Link Purpose (In Context): The purpose of each link can be determined from the link text alone or from the link text together with its programmatically determined link context, except where the purpose of the link would be ambiguous to users in general. (Level A)

@dylanb
Copy link
Contributor

dylanb commented Jun 19, 2017

@robfentress thank you for the feedback. We think that when a link has no text at all, that is not an issue of a duplicate link (that would at least require two links and a text of some sort) but is rather due to one of two common errors:

  1. The user is using the anchor tag, not as an anchor, but for some other purpose

  2. Most commonly - that the anchor contains an image that is also missing an alt attribute

Therefore this is mapped to 4.1.2 (role) and 1.1.1 (alternative text)

@robfentress
Copy link
Author

robfentress commented Jun 19, 2017

The example that triggered the error for me was that the page had a skip link and the contents of the skip link was a span with text in it. That span had display:none set until the link received focus. Therefore, in essence the link was empty unless it had focus. I think 2.4.4 is most accurate, in this instance, because someone using a screen reader who comes across this link using the virtual cursor or by bringing up a list of links on the page will, likely, be presented with an empty link and will not know the purpose of the link.

@robfentress
Copy link
Author

P.S. I don't remember what is presented in different screen readers when there are links with no content, but I'm guessing it will be something and that something will not be helpful.

@dylanb
Copy link
Contributor

dylanb commented Jun 19, 2017

So, for reference, here are the S.C.s

2.4.4 Link Purpose (In Context): The purpose of each link can be determined from the link text alone or from the link text together with its programmatically determined link context, except where the purpose of the link would be ambiguous to users in general. (Level A)

4.1.2 Name, Role, Value: For all user interface components (including but not limited to: form elements, links and components generated by scripts), the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies. (Level A)

The Deque argument here is that if the name is missing, then it definitely violates 4.1.2 and you cannot even evaluate 2.4.4 when there is no link text (name). However, I can see your point...

@WilcoFiers any objections to adding this S.C.?

@goodwitch
Copy link
Contributor

+1 to added a reference to SC 2.4.4 for this failure. Supported by F89 being listed as a failure for 2.4.4 https://www.w3.org/TR/2016/NOTE-WCAG20-TECHS-20161007/F89

@dylanb dylanb added feat New feature or enhancement rules Issue or false result from an axe-core rule labels Jun 19, 2017
@dylanb dylanb closed this as completed in 70728e6 Jun 19, 2017
dylanb added a commit that referenced this issue Jun 19, 2017
feat: add S.C. 2.4.4 to link-name rule.

Fixes #369
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or enhancement rules Issue or false result from an axe-core rule
Projects
None yet
Development

No branches or pull requests

3 participants