Skip to content

NVDA not properly present an image when role="math" is present #16007

Closed

Description

@GeorgeKerscher

Description:

In digital books, many authors and publishers include math by using an image. While MathML is recommended, some will still deliver an image with alt text. When the role on the image is set to math, i.e., role="math" NVD is notperforming as expected. We would expect:

  • You should be able to do first letter navigation, i.e., press "g" to go to the graphic.
  • You should be able to read the alt text by word or character.

Steps to reproduce:

  1. visit Test for ARIA Math Role on an Image
  2. Read the page, which contains an image of a math expression that includes alt text. It has a role="math".
  3. Notice that the alt text is read as a single line.
  4. Try to read the alt text by word or character, which you cannot do.
  5. Go to the top of the page and in browse mode using single letter navigation hit "g" to go to graphic, and you will not find the image.

Actual behavior:

Example speech output from the sample referenced.

This marks the spot where speech viewer started to capture the output. The page is visited and we get:
Begin speech viewer output
enter
Test for ARIA Math Role on an Image document
heading level 1 Test for ARIA Math Role on an Image
up arrow
heading level 1 Test for ARIA Math Role on an Image
down arrow
heading level 2 Introduction
down arrow
This test is to evaluate how assistive technologies interpret an image with math role and
down arrow
alternative text.
down arrow
heading level 2 Test
down arrow
Quadratic formula: x=⟮−b±√⟮b²−4ac⟯⟯÷2a
right arrow
space
ctrl+right arrow
space
ctrl+home
heading level 1 Test for ARIA Math Role on an Image
no next graphic

End speech viewer output

Notice that the alt text is read, but cannot be navigated. Also notice that with single letter navigation, the graphic (img) is not found.

Expected behavior:

The expected behavior is to have the ability to read alt text by character and word. Also, because it is a graphic, you should be able to go to it by hitting the letter G.

NVDA logs, crash dumps and other attachments:

Not aplickable.

System configuration

NVDA installed/portable/running from source:

NVDA is installed on this computer.

NVDA version:

About NVDA NonVisual Desktop Access (NVDA)
Version: 2023.3 (2023.3.0.29780)
URL: https://www.nvaccess.org/
Copyright (C) 2006-2

Windows version:

About Windows Microsoft Windows
Version 23H2 (OS Build 22631.2861)
©

Name and version of other software in use when reproducing the issue:

This behavior is with the browsers Chrome, Edge, and Firefox latest version.
The Chrome version is: Version 120.0.6099.199 (Official Build) (64-bit)

Other information about your system:

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

We noticed this vehavior on the previous version of NVDA as well.

If NVDA add-ons are disabled, is your problem still occurring?

Yes, when all add-ons are disabled the behavior is the same.

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Yes!

Activity

  1. Adriani90 commented on Jan 6, 2024

    @Adriani90
    Collaborator

    This michgt be a duplicate of #13702. or #5862. Both indicate that this needs an external fix.

  2. lukaszgo1 commented on Jan 6, 2024

    @lukaszgo1
    Contributor

    Setting role of an object to math means that the original role of graphic cannot be conveyed to ATS - HTML has no concept of multiple roles. Why these images are given a role of math in the first place? If this is only to have them announced as math, you can provide alternative role description with aria-roledescription, but in general this is not recommended. When I'd hear that something is math then this implies that I can interact with this element using MathPlayer and have the content rendered in Braille, so it is better to report that the element is a graphic, and present the content in the alt text without changing the role.

  3. GeorgeKerscher commented on Jan 6, 2024

    @GeorgeKerscher
    Author

    this issue is not a duplicate of those two. They relate to the presence of MathML. This is addressing the content of an image. It is somewhat related, because if publishers mark the images of math with the role="math" then we would have more opportunities to convert the image of math into proper MathML through a post process.

  4. GeorgeKerscher commented on Jan 6, 2024

    @GeorgeKerscher
    Author

    I agree that the best practice for authors and publishers is to use MathML, but there are many cases where this guidance is not being followed. We have written a position statement on this.
    [Position Paper on using MathML] (https://daisy.github.io/transitiontoepub/information-sharing/position-paper-plain-text-math/)

    It seems that placing role=math" on an image of math conveys the semantics. If this attribute is set then organizations that provide materials to persons with disabilities could easily identify the images of math and convert it to MathML. However, if we make a best practice recommendation of the fallback for publishers that produce images of math to use this attribute, then NVDA should treate it as an image and allow navigation to it and review of the alt text.

  5. lukaszgo1 commented on Jan 6, 2024

    @lukaszgo1
    Contributor

    It looks like this is a supported use case according to this W3C documentation. I'm not sure if I personally agree with this, as it seems to be abusing the role concept, but that is probably a discussion for a different place. Note that even when we will make the alt text reviewable making sure that these can be navigated to with the g key is going to be tricky, as we don't support multiple roles for a single object. There is also a question of how to report such objects, as math or as an image. Have you investigated how other screen readers behave here? cc @jcsteh

  6. GeorgeKerscher commented on Jan 6, 2024

    @GeorgeKerscher
    Author

    I just checkected with Jaws 2024.3 and you can get to the image with the g single letter navigation. The alt text can also be reviewed with the arrow keys.

    I will wait for others on our team to respond about other platforms.

  7. lukaszgo1 commented on Jan 6, 2024

    @lukaszgo1
    Contributor

    What role is reported for this object by JAWS - math, or image?

  8. clapierre commented on Jan 16, 2024

    @clapierre

    BTW on a Mac with Voice Over when you have an image with alt text describing the math and role="math" the results are mixed.

    Safari with Voice Over you hear the alt text description followed by "empty math" eg: "x+5=7 empty math" where the image alt="x+5=7" role="math" was provided.

    Chrome with Voice Over all you hear is "math" and not the alt text description.

  9. gregoriopellegrino commented on Mar 5, 2024

    @gregoriopellegrino

    To add context. On Android using Chrome + Talkback the screen reader reads the alt-text content followed by "math element" (using a different voice than the one used for the main content).

    For example "x+5=7 math element".

  10. GeorgeKerscher commented on Feb 26, 2025

    @GeorgeKerscher
    Author

    NVDA still needs improvements with role="math"

    The transition to Accessible EPUB working group is updating our best practice recommendations for math. Our fundamental recommendation to publishers is still to use MathML. However, we know that there are many legacy documents with images of math. If the publisher cannot update the content to MathML, they should be able to apply the role="math" to those images. This will help in many ways.

    • it will enable people doing remediation tofind these items for conversion to MathML
    • It will help when AI is used on the image.
    • When a screen reader encounters these images it can do a number of things.

    We have updated our testing results forscreen readers and NVDA needs improvement. Find the results at:
    Testing results for role="math"

    With NVDA we would want:

    • Single letter navigation to images with role="math"
    • Be able to read the alt text by line or continuous reading
    • Announce math content
    • be able to explore the alt text by word and character.
      We have the link to the test at the beginning of this issue, but here it is again for convenience:

    Test for ARIA Math Role on an Image

  11. added this to the 2025.1 milestone on Mar 17, 2025
  12. added a commit that references this issue on Mar 18, 2025
    bd881f4
  13. GeorgeKerscher commented on Mar 20, 2025

    @GeorgeKerscher
    Author

    I Installed the nightly build of NVD and tested with the example where role="math"

    I see this was closed. I suggest this is reopen and propose two modifications. You can now navigate to the image with single letter navigation for a graphic. It now allows the exploration of the alt text properly, which is great. However, there are two things we suggest to be added.

    1. When reaching the element, instead of graphic, it should say, "math content."
    2. We would like to see single letter navigation to role="math," just like navigation to MathML behaves.

    We think this will help us with legacy content where publishers could add the role="math" and the do not have the resources to add MathML. We also think this will help when the titles are remediated by organizations serving persons with disabilities.

  14. michaelDCurran commented on Mar 20, 2025

    @michaelDCurran
    Member
  15. clapierre commented on Mar 21, 2025

    @clapierre

    I agree that this issue is resolved, and a new issue needs to be created, please link the new issue to this one for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions