Skip to content

Skip link placement: All page content should be contained by landmarks #4240

@tmc-ee

Description

@tmc-ee

Product

axe-core

Product Version

4.8.2

Latest Version

  • 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

  1. open up https://www.tax.service.gov.uk/help/terms-and-conditions
  2. you should see a cookie consent banner
  3. run axe with the banner open
  4. the skip link on the page won't be detected as a skip link and you will get a violation
  5. close the banner (i.e. click reject additional cookies, click hide cookies message)
  6. rerun axe
  7. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixBug fixesrulesIssue or false result from an axe-core rule

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions