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

landmark-unique seems to contradict W3C spec #4447

Open
1 task done
TimCanu opened this issue May 4, 2024 · 3 comments
Open
1 task done

landmark-unique seems to contradict W3C spec #4447

TimCanu opened this issue May 4, 2024 · 3 comments
Labels
best practice fix Bug fixes rules Issue or false result from an axe-core rule

Comments

@TimCanu
Copy link

TimCanu commented May 4, 2024

Product

playwright

Product Version

4.9.0

Latest Version

  • I have tested the issue with the latest version of the product

Issue Description

Expectation

Here is a code pen on which the issue is detailed. I don't know how to easily share this with playwright but a code like the following should yield the same error:

await page.goto('https://codepen.io/TimCanYou/pen/mdgNyRz')
const accessibilityScanResults = await new AxeBuilder({ page }).exclude("").analyze()
expect(accessibilityScanResults.violations).toEqual([])	

I have a table showing data. Above and below the table are one navigation landmark (both are identical). In such a situation, according to W3C:
If a specific landmark role is used more than once on a page, provide each instance of that landmark with a unique label. There is one rare circumstance where providing the same label to multiple instances of a landmark can be beneficial: the content and purpose of each instance is identical. For example, a large search results table has two sets of identical pagination controls -- one above and one below the table, so each set is in a navigation region labelled Search Results. In this case, adding extra information to the label that distinguishes the two instances may be more distracting than helpful.
So I don't expect the error "landmark-unique" for my <nav>s having the same aria-label...

Actual

I have the error "landmark-unique": https://dequeuniversity.com/rules/axe/4.9/landmark-unique?application=playwright

How to Reproduce

code pen

If you consider that this is expected and wanted behaviour, what is your recommendation in such a case?

@straker
Copy link
Contributor

straker commented May 6, 2024

Thanks for the issue. This is an axe-core issue so I'm going to transfer it there.

@straker straker transferred this issue from dequelabs/axe-core-npm May 6, 2024
@straker straker added the ungroomed Ticket needs a maintainer to prioritize and label label May 6, 2024
@WilcoFiers
Copy link
Contributor

@TimCanu Thank you for reporting this. I agree with you, this is a reasonable exception that we didn't account for in the rule. Is this something you encountered on a live website?

@WilcoFiers WilcoFiers added fix Bug fixes rules Issue or false result from an axe-core rule best practice and removed ungroomed Ticket needs a maintainer to prioritize and label labels May 10, 2024
@TimCanu
Copy link
Author

TimCanu commented May 13, 2024

Hello @WilcoFiers
This is something I encountered on a personal project (so not really live as it is a WIP)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
best practice fix Bug fixes rules Issue or false result from an axe-core rule
Projects
None yet
Development

No branches or pull requests

3 participants