Skip to content

[web:a11y] switch header from role "heading" to role "banner" #152268

@yjbanov

Description

@yjbanov

On this line:

https://github.com/flutter/engine/blob/511a8ef6e69569419c54ec223eb20dd74e64eeed/lib/web_ui/lib/src/engine/semantics/semantics.dart#L715

When a semantic node self-identifies as isHeader, the web engine assigns the "heading" role. However, the more appropriate ARIA role would be "banner".

It is also worth revisiting this line:

https://github.com/flutter/engine/blob/511a8ef6e69569419c54ec223eb20dd74e64eeed/lib/web_ui/lib/src/engine/semantics/semantics.dart#L690

Currently the GenericRole expects the header to have a label. However, the UI structure could be such that the header is a parent of multiple other semantic elements. See the MDN example that has a <header> containing an <h1> and <time>.

A more complete solution is probably to create a PrimaryRoleManager (to be renamed to SemanticRole in flutter/engine#54070) for header, and stop relying on the GenericRole, which is really just a fallback when we couldn't think of a better role for a node.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)engineflutter/engine related. See also e: labels.platform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions