Skip to content

focus-order-semantics false positive on role="article" elements #3905

@philipjia123

Description

@philipjia123

Product

axe-core

Product Version

4.6.3

Latest Version

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

Issue Description

Expectation

The focus-order-semantics rule should not raise a violation for an element in the focus order with role="article" since it's listed as one of the allowable roles at https://dequeuniversity.com/rules/axe/4.6/focus-order-semantics.

Actual

Running axe on an element such as <div role="article" tabindex="0"> creates a focus-order-semantics violation.

How to Reproduce

  1. Open https://codepen.io/philipjia123-the-reactor/full/ZEjNWZe
  2. Run axe with experimental rules enabled
  3. Observe that a focus-order-semantics violation is produced

Additional context

This seems to be an issue with the article role being omitted from the VALID_ROLES_FOR_SCROLLABLE_REGIONS list:

const VALID_ROLES_FOR_SCROLLABLE_REGIONS = {
application: true,
banner: false,
complementary: true,
contentinfo: true,
form: true,
main: true,
navigation: true,
region: true,
search: false
};
even though the corresponding tag name is included
const VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS = {
ARTICLE: true,
ASIDE: true,
NAV: true,
SECTION: true
};

Happy to put in a quick pull request, just wanted to make sure this is actually a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixBug fixesrulesIssue or false result from an axe-core rule

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions