Question about possibly moving from data-mathml to another solution

14 views
Skip to first unread message

Aaron Leventhal

unread,
Jul 8, 2024, 12:37:18 PM (8 days ago) Jul 8
to mathj...@googlegroups.com
Hello, Blink Accessibility developer here.

I recently saw data-mathml in our Blink accessibility code, and learned about it. It looks like MathJax and Google Sheets use it, even though it's nonstandard. The problem with it being nonstandard is that it will have less even support across browser and environments, and there isn't a place for web authors to learn about it, if they want to use it. I see that even in the original issue it was pointed out that this would be nonstandard.

Would MathJax be open to changing its approach slightly?
My goal is to use standards and then eventually deprecate data-mathml.

Idea #1: use innerHTML positioned offscreen. I see that in fact innerHTML is provided in this example: https://mathjax.github.io/MathJax-demos-web/mml-attribute.html inside the child <mjx-assistive-mml> child element.
- Does MathJAX always provide this?
- Could the parent <mjx-container> element with tabindex=0 be modified to use role="math" instead? That would allow us to expose the child innerHTML contents the same way we expose the data-mathml to ATs (we would modify Blink to remove the aria-hidden child used for rendering).

Idea #2: request that ARIA WG add an aria-mathml attribute (I'm on the ARIA WG and can work on trying to get this through). However, if approach #1 works, it may be unnecessary.

Thoughts appreciated.

Aaron

deniz sincar

unread,
Jul 8, 2024, 1:57:04 PM (8 days ago) Jul 8
to mathj...@googlegroups.com
I very, very doubt mathjax will go away from MathML because all screenreaders for blind depend on it.
Отправлено с iPhone

8 июля 2024 г., в 19:37, 'Aaron Leventhal' via MathJax Development <mathj...@googlegroups.com> написал(а):


--
You received this message because you are subscribed to the Google Groups "MathJax Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-dev/CA%2B1LECRr%3D-1WnxBZ-wowsg_M-guRx%3DHKx8go568bAhv60ByYwA%40mail.gmail.com.

Davide Cervone

unread,
Jul 8, 2024, 9:22:28 PM (8 days ago) Jul 8
to mathj...@googlegroups.com
Aaron:

The issue you link to was started nearly 10 years ago (during MathJax v2.5), and the discussion there lead to the development of MathJax's AssistiveMML extension, which was included in v 2.6 and above.  That extension inserts a MathML version of the mathematical expressions into a DOM element that is visually hidden, but still part of the DOM that is available to AT.  The original AssistiveMML extension also put the MathML into the data-mathml attribute, so both hidden MathML as actual DOM elements and the data-mathml attributes were available. 

The assistive-mml extension in v3 dropped the use of the data-mathml attribute, so that hasn't been part of the current MathJax for quite some time.  While in v2, the AssistiveMML extension had to be activated by the user through the MathJax contextual menu, in v3 that feature was on by default in all the combined component files.  It can still be turned off in the contextual menu, and is configurable by page authors, so they can choose not to enable it, but it could be turned on again by users.

I believe the visually hidden MathML generated by the assistive-mml extension is basically what you are asking for in #1 (though it is not off screen, it is at the location of the typeset mathematics, just not visible).  As described above, in most cases the MathML will be available in the DOM automatically within the <mjx-assistive-mml> child of the <mjx-container>, unless the page author specifically configures that feature to be disabled, and then the user can enable it again through the menu.

You ask about using role="math"; my recollection is that we did that at one time (in v2) and that it was problematic.  That is not my field of expertise, so I'm not sure what the issue was, but we stopped doing that early on.

In v4.0.0-beta.6, the speech-generation in MathJax now adds aria-label and aria-braillelabel attributes with the speech and Braille strings for the math, and the assistive-mml extension is disabled (though users can disable the aria labels and re-enable the assistive-mml) if they prefer.  This should allow screen readers to read the math even if they don't understand MathML, and the speech strings can be provided in any of a dozen or more languages, using any of three different speech rule sets (MathSpeak, ClearSpeak, and ChromeVox).  Furthermore, the sub-expressions within the typeset mathematics will have ARIA labels as well, so the expression can be "walked" to have individual terms read rather than the complete expression.  MathJax provides an expression explorer that implants that walking of the expression tree.

The beta.6 version has some performance issues related to the new paradigm in use for the expression explorer, and we are readying a beta.7 that should address those issues.  This new approach is still being refined, but the assistive-mml extension was always meant as a stop-gap and is problematic in a number of ways (mostly described in the issue you link to), in particular, the disconnect between the hidden MathML and the actual displayed expression.  In v4, we will no longer rely on invisible MathML as the default (though pages can configure that, and users can request it).

If you would like to discuss these issues in person, let me know, and I can arrange a call.

Davide


Reply all
Reply to author
Forward
0 new messages