Skip to content

Images with role=math but no actual mathml should be treated as normal images#17832

Merged
SaschaCowley merged 3 commits into
masterfrom
i16007
Mar 17, 2025
Merged

Images with role=math but no actual mathml should be treated as normal images#17832
SaschaCowley merged 3 commits into
masterfrom
i16007

Conversation

@michaelDCurran

Copy link
Copy Markdown
Member

Link to issue number:

Fixes #16007

Summary of the issue:

In the past, many content publishers have been representing math equations is an image along with alt text containing some kind of plain-text math representation, rather than using actual mathml. However, they have also been placing role=math on these images, which confuses NVDA. The image then no longer is treated in browse mode like an image (it does not report graphic, you can't jump to it with g, nor can you arrow through the alt text character by character). And since there is no mathml for rich navigation, the equation cannot be navigated through at all.

Description of user facing changes

Description of development approach

  • gecko_ia2 c++ virtualBuffer: change the accRole from equation to graphic, if the tag IAccessible2 object attribute is img, as this Accessible represents an image, whose role has been inappropriately overridden to equation by an ARIA role of math. This then allows all standard logic for images to apply in Browse Moe for this node.
  • in the math NVDAObject: change the role to graphic, if the accRole is equation and there is no mathml for this node. This correct reporting wih object navigation.

Testing strategy:

Known issues with pull request:

None known.

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.

@coderabbitai summary

@michaelDCurran michaelDCurran requested a review from a team as a code owner March 17, 2025 08:10
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit c9f42c9068

@SaschaCowley SaschaCowley 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.

Thanks, @michaelDCurran

@SaschaCowley SaschaCowley merged commit bd881f4 into master Mar 17, 2025
@SaschaCowley SaschaCowley deleted the i16007 branch March 17, 2025 23:41
@github-actions github-actions Bot added this to the 2025.1 milestone Mar 17, 2025
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 not properly present an image when role="math" is present

3 participants