Skip to content

Fix invalid math formatting report for ARIA role math in Chromium - #20734

Open
cary-rowen wants to merge 1 commit into
nvaccess:masterfrom
cary-rowen:fixMath
Open

Fix invalid math formatting report for ARIA role math in Chromium#20734
cary-rowen wants to merge 1 commit into
nvaccess:masterfrom
cary-rowen:fixMath

Conversation

@cary-rowen

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #20727

Summary of the issue:

In Chromium based browsers, elements with role="math" and an accessible name can expose their inner HTML through the IA2 math attribute.

NVDA treated this attribute as raw MathML, wrapped it in a <math> element, and passed the invalid markup to MathCAT. This caused NVDA to report invalid math formatting before reading the accessible name.

Description of user facing changes:

NVDA no longer reports invalid math formatting for ARIA role="math" elements in Chromium based browsers when the element provides an accessible name but no MathML.

Description of developer facing changes:

None.

Description of development approach:

The IA2 math attribute is now only treated as raw MathML when the object itself is a native MathML element.

For non-native role="math" elements, NVDA still checks for data-mathml and still supports the existing fallback where a wrapper contains a single native <math> child. If no MathML is found, _get_mathMl raises LookupError, allowing NVDA to fall back to the element's accessible name.

Testing strategy:

Manually tested using the reproduction case from #20727:

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>ARIA math test</title>
<p>The expression is <span role="math" aria-label="x plus y"><span aria-hidden="true">x + y</span></span>.</p>
</html>

In Chrome/Edge browse mode, moving to the expression no longer reports invalid math formatting, and NVDA reads the accessible name.

Also verified MathML content still works in Chromium by navigating math formulas in answers on chat.openai.com.

Known issues with pull request:

No known issues.

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.

@cary-rowen
cary-rowen marked this pull request as ready for review August 25, 2026 08:48
@cary-rowen
cary-rowen requested a review from a team as a code owner August 25, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA reports invalid math formatting for valid ARIA role="math" content in Chromium

1 participant