dequelabs / dequelabs/axe-core

landmark-unique seems to contradict W3C spec

Open
#4,447 3 comments 0 reactions 0 assignees View on GitHub
best practice fix rules
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 23h
Merged PRs (30d)
17

Description

### Product

playwright

### Product Version

4.9.0

### Latest Version

- [X] I have tested the issue with the latest version of the product

### Issue Description

#### Expectation
[Here](https://codepen.io/TimCanYou/pen/mdgNyRz) 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](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/#aria_lh_step3):
_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 ``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](https://codepen.io/TimCanYou/pen/mdgNyRz)

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.