Skip to content

header in section with role should not have role banner #3752

@lexanth

Description

@lexanth

Product

axe-core

Product Version

4.4.1

Latest Version

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

Issue Description

Expectation

Given a dialog which is labelled by a header:

<section role="dialog" aria-labelledby="dialog-header">
  <header id="dialog-header">My header</header>
  <div>Some dialog content</div>
</section>

I would expect the accessible name of the dialog to be identified as "My header"

Actual

I get a violation on "ARIA dialog and alertdialog nodes should have an accessible name (aria-dialog-name)"

On further investigation:

How to Reproduce

See HTML in Expectation

Additional context

I haven't verified if a screen reader identifies the header as the dialog header.

I haven't seen anywhere that says that sectioning HTML elements are only sectioning when they don't have a role. https://www.w3.org/TR/2010/WD-html5-20101019/content-models.html#sectioning-content-0

All of the valid roles for a section in https://www.w3.org/TR/2010/WD-html5-20101019/content-models.html#annotations-for-assistive-technology-products-aria seem like they should still act as sectioning elements. I think invalid roles would be caught by the corresponding rule?

I can work around this by explicitly setting role="none" on my header.

Metadata

Metadata

Assignees

Labels

Accessible textfixBug fixesprA pr has been created for the issuerulesIssue or false result from an axe-core rule

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions