Skip to content

[a11y] web does not create correct dialog role for dialog #153791

@chunhtai

Description

@chunhtai

Steps to reproduce

Run a11y_assessment app with chrome
https://github.com/flutter/flutter/tree/master/dev/a11y_assessments

  1. click dialog
  2. click show dialog

See the semantics dump contains a scopesRoute

Details ``` SemanticsNode#0 │ Rect.fromLTRB(0.0, 0.0, 1200.0, 549.0) │ └─SemanticsNode#1 │ Rect.fromLTRB(0.0, 0.0, 1200.0, 549.0) │ textDirection: ltr │ ├─SemanticsNode#55 │ │ Rect.fromLTRB(0.0, 0.0, 1200.0, 549.0) │ │ sortKey: OrdinalSortKey#dfbe2(order: 0.0) │ │ │ └─SemanticsNode#56 │ │ Rect.fromLTRB(0.0, 0.0, 1200.0, 549.0) │ │ flags: scopesRoute │ │ │ └─SemanticsNode#57 │ │ Rect.fromLTRB(40.0, 233.0, 1160.0, 316.0) │ │ label: "This is a typical dialog." │ │ textDirection: ltr │ │ elevation: 6.0 │ │ │ ├─SemanticsNode#58 │ │ Rect.fromLTRB(8.0, 43.0, 64.0, 75.0) │ │ actions: focus, tap │ │ flags: isButton, hasEnabledState, isEnabled, isFocusable │ │ label: "OK" │ │ textDirection: ltr │ │ │ └─SemanticsNode#59 │ Rect.fromLTRB(64.0, 43.0, 131.2, 75.0) │ actions: focus, tap │ flags: isButton, hasEnabledState, isEnabled, isFocusable │ label: "Cancel" │ textDirection: ltr │ └─SemanticsNode#54 Rect.fromLTRB(0.0, 0.0, 1200.0, 549.0) actions: dismiss, tap label: "Dismiss" textDirection: ltr sortKey: OrdinalSortKey#f9f86(order: 1.0) ```

but the dom tree doesn't create a semantics node for role=dialog
image

This is causing the screen reader to not recognize the route change

Actual results

It should generate one semantics node with role=dialog.

Logs

Logs
<!-- Paste your logs here -->

Flutter Doctor output

Doctor output
<!-- Paste your output here -->

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)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