Use IA2 math attribute instead of ISimpleDOM when possible - #20049
Merged
Merged
Conversation
ISimpleDOM when possible
ISimpleDOM when possiblemath attribute instead of ISimpleDOM when possible
Contributor
There was a problem hiding this comment.
Pull request overview
Improves MathML retrieval for Chromium-based browsers by preferring the IA2 math attribute (to avoid reliance on ISimpleDOM registration), with a changelog entry documenting improved reliability.
Changes:
- Prefer IA2
mathattribute inMath._get_mathMland strip embedded HTML comments before returning MathML. - Fall back to existing ISimpleDOM-based retrieval when the IA2
mathattribute is unavailable. - Add a user-facing changelog note about improved MathML reading reliability in Chromium.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
source/NVDAObjects/IAccessible/ia2Web.py |
Adds IA2 math attribute path for MathML retrieval (with comment stripping) ahead of ISimpleDOM fallback. |
user_docs/en/changes.md |
Documents improved MathML reading reliability in Chromium after NVDA start/restart. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
seanbudd
approved these changes
May 4, 2026
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
This serves as a fix for the math reading bug in #19813, but doesn't entirely close that issue since the underlying issue with ISimpleDOM is still present.
Summary of the issue:
NVDA can fail to read MathML in Chromium if the page was already open before NVDA starts or restarts. This seems to be due to ISimpleDOM not being registered.
Description of user facing changes:
Math is more reliably read in Chromium, even when a page is already opened before NVDA starts or restarts.
Description of developer facing changes:
The method
Math._get_mathMlnow checks the IA2mathattribute before falling back to ISimpleDOM.Description of development approach:
Update
Math._get_mathMlto use the IA2 math attribute when available, strip embedded HTML comments, and return the result wrapped in<math>. If the IA2mathattribute is not available, fall back to the existing ISimpleDOM behavior.A quick note about the embedded HTML comments: I only realized stripping of HTML comments was necessary after testing an initial implementation. It seems like Chromium inserts HTML comments into the IA2
mathattribute, which was causing parse errors in MathCAT.Testing strategy:
Known issues with pull request:
None.
Code Review Checklist: