axe-core
                                
                                 axe-core copied to clipboard
                                
                                    axe-core copied to clipboard
                            
                            
                            
                        axe-code is not reporting duplicated links on a page (link-name)
Product
axe-core
Product Version
4.7.2
Latest Version
- [X] I have tested the issue with the latest version of the product
Issue Description
Expectation
axe-core should report duplicated links on the page, based on https://dequeuniversity.com/rules/axe/4.7/link-name.
Actual
axe-code is not reporting duplicated links on the page, based on https://dequeuniversity.com/rules/axe/4.7/link-name.
How to Reproduce
Code sample: https://codesandbox.io/s/patient-worker-x7shvk?file=/index.html
- Open https://codesandbox.io/s/patient-worker-x7shvk?file=/index.html
- Try to open the link directly (https://x7shvk.csb.app/), without all the CodeSandbox UI
- Run axe DevTools
- You should get some issues, but no mention of the duplicated links mentioned in https://dequeuniversity.com/rules/axe/4.7/link-name
VoiceOver shows the issue visually:
Additional context
Here are the screenshots I took from the report in our application:
- axe results
- Voice-over links
- code/visual
Thanks for the issue. So the link-name rule does not check if the name of the link is a duplicate. It only checks if the link has an accessible name (regardless of what it is).
The rule identical-links-same-purpose does however check the name of the links and verifies that each link that uses the same name also points to the same URL. It only returns Needs Review items though so you won't seem them as violations.
Thanks for the issue. So the
link-namerule does not check if the name of the link is a duplicate. It only checks if the link has an accessible name (regardless of what it is).The rule
identical-links-same-purposedoes however check the name of the links and verifies that each link that uses the same name also points to the same URL. It only returns Needs Review items though so you won't seem them as violations.
Thank you for the fast response. Does the sentence below deserve a review?
"Link text and alternate text for images, when used as links, must be discernible by a screen reader, must not have a duplicate label, and must be focusable."
It says "not have a duplicated label". Is that referring to links or inputs?
Oh you're right. How interesting. I believe that is a doc error on our end as the rule definitely does not check for duplicate labels.
Awesome @straker! Thanks for working on this and providing fast feedback!
But I wonder why this is not a WCAG rule. It's clear that once you open the VoiceOver menu, you get a lot of "Edit" "Edit" "Edit". It's too confusing to the final user.
I agree. Success Criterion 2.4.4 is intended to ensure that links can be understood from context alone, however axe-core is unable to determine programmatically if any link text would fail that part of the success criterion. Axe-core does not and cannot fully satisfy most success criterion due to needing human judgement call for some parts.