Skip to content

fix: announce all content inside role="alert"#20056

Merged
seanbudd merged 9 commits into
nvaccess:masterfrom
mehm8128:role-alert-announce-all-contents
May 29, 2026
Merged

fix: announce all content inside role="alert"#20056
seanbudd merged 9 commits into
nvaccess:masterfrom
mehm8128:role-alert-announce-all-contents

Conversation

@mehm8128

@mehm8128 mehm8128 commented May 5, 2026

Copy link
Copy Markdown
Contributor

Link to issue number:

close #14990

Summary of the issue:

The content of HTML element with role="alert" had only announced its focusable children contents.

Description of user facing changes:

NVDA now announces all content inside role="alert" elements.

Description of developer facing changes:

Description of development approach:

I extended the condition of what role is announced. I added heading, list, listitem, and paragraph roles.

Testing strategy:

test with sample code described in the original issue and confirm that all contents inside role="alert" are announced.
on both Chromium and Firefox, it performs as expected.

Known issues with pull request:

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

Copilot AI review requested due to automatic review settings May 5, 2026 06:23
@mehm8128 mehm8128 requested a review from a team as a code owner May 5, 2026 06:23
@mehm8128 mehm8128 requested a review from SaschaCowley May 5, 2026 06:23
@mehm8128 mehm8128 changed the base branch from master to rc May 5, 2026 06:25
@mehm8128 mehm8128 changed the base branch from rc to master May 5, 2026 06:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes NVDA’s handling of HTML/ARIA role="alert" so that alert events announce the full contents of the alert container (not just focusable descendants), addressing #14990.

Changes:

  • Update IAccessible alert event handling to speak all recursive descendants of an alert container.
  • Add a user-facing changelog entry noting improved role="alert" announcements.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
source/NVDAObjects/IAccessible/__init__.py Expands alert announcement logic to iterate through and announce all descendant content.
user_docs/en/changes.md Documents the user-facing change for role="alert" announcements.

Comment thread source/NVDAObjects/IAccessible/__init__.py Outdated
Comment thread source/NVDAObjects/IAccessible/__init__.py Outdated
Comment thread source/NVDAObjects/IAccessible/__init__.py
@seanbudd seanbudd added the merge-early Merge Early in a developer cycle label May 11, 2026
@seanbudd seanbudd added this to the 2026.3 milestone May 11, 2026
@mehm8128 mehm8128 force-pushed the role-alert-announce-all-contents branch from e20ded3 to 8989eb8 Compare May 11, 2026 13:12
@seanbudd seanbudd requested a review from michaelDCurran May 15, 2026 01:09
@seanbudd seanbudd removed this from the 2026.3 milestone May 15, 2026
Comment thread source/NVDAObjects/IAccessible/__init__.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread source/NVDAObjects/IAccessible/__init__.py Outdated
Comment thread source/NVDAObjects/IAccessible/__init__.py Outdated
@mehm8128 mehm8128 force-pushed the role-alert-announce-all-contents branch from 0853cd2 to 4e09548 Compare May 15, 2026 10:58
@pre-commit-ci pre-commit-ci Bot requested a review from a team as a code owner May 15, 2026 11:00
@pre-commit-ci pre-commit-ci Bot requested a review from Qchristensen May 15, 2026 11:00
Comment thread projectDocs/issues/githubIssueTemplateExplanationAndExamples.md
@mehm8128 mehm8128 requested a review from seanbudd May 15, 2026 11:03

@Qchristensen Qchristensen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes.md line reads well.

@seanbudd

Copy link
Copy Markdown
Member

can you merge in latest master please?

@seanbudd seanbudd marked this pull request as draft May 21, 2026 05:35
@seanbudd

Copy link
Copy Markdown
Member

There may be some double speaking if the author of the HTML does the right thing and sets aria-description or aria-describedby. Have you tested this case? If there's double speaking, can you consider adding a filter to check if the description is there and therefore just do focusable children like now.

@mehm8128

Copy link
Copy Markdown
Contributor Author

I confirmed that the double speaking occurs, so I fixed it as you suggested.

@mehm8128 mehm8128 marked this pull request as ready for review May 27, 2026 11:27
@seanbudd

seanbudd commented May 28, 2026

Copy link
Copy Markdown
Member

please merge in the latest master as requested previously. Otherwise unrelated changes will continue to show up in the diff

@mehm8128 mehm8128 force-pushed the role-alert-announce-all-contents branch from a286f46 to 0e5565c Compare May 28, 2026 03:39
@mehm8128

Copy link
Copy Markdown
Contributor Author

Sorry, I had overlooked that. I rebased the latest master.

Comment thread user_docs/en/changes.md Outdated
@mehm8128 mehm8128 requested a review from seanbudd May 28, 2026 13:12
Comment thread user_docs/en/changes.md Outdated
@seanbudd seanbudd merged commit 62ab867 into nvaccess:master May 29, 2026
38 checks passed
@github-actions github-actions Bot added this to the 2026.3 milestone May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-early Merge Early in a developer cycle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA does not announce contents of div with role="alert" containing a list

4 participants