axe-core
axe-core copied to clipboard
Skip link placement: All page content should be contained by landmarks
Product
axe-core
Product Version
4.8.2
Latest Version
- [X] I have tested the issue with the latest version of the product
Issue Description
Expectation
A skip link placed outside a landmark should not trigger a violation based on region rule, i.e. All page content should be contained by landmarks
It is best practice to contain all content excepting skip links, within distinct regions such as the header, nav, main, and footer.
Actual
If a skip link is not the first href defined on the page, a region violation is triggered due to the isSkipLink check.
How to Reproduce
- open up https://www.tax.service.gov.uk/help/terms-and-conditions
- you should see a cookie consent banner
- run axe with the banner open
- the skip link on the page won't be detected as a skip link and you will get a violation
- close the banner (i.e. click reject additional cookies, click hide cookies message)
- rerun axe
- the skip link is correctly detected and you will not get a violation
Additional context
The skip link is placed after the cookie banner as per GOV.UK design system guidance on Cookie Banner placement
Position the cookie banner after the opening
tag and before the ’skip to main content‘ link.
Thanks for the issue. We'll look into ways we could address this.