MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

aria-hidden and focusable children

Open pkra opened this issue 5 years ago • 5 comments

MathJax currently adds aria-hidden to its container element. When there are links in the MathJax output, such links are focusable but in aria-hidden parents which is problematic, e.g., for non-visual users tabbing to the link in an aria-hidden area and thus no accessible name. In addition, the link might not have an accessible name (e.g., in SVG output).

Oddly, this is the case even when the accessibility explorer is active (when aria-hidden shouldn't be necessary). It's also unfortunate in situations like $\ref{...}$.

pkra avatar Jan 12 '21 22:01 pkra

This seems to be a tricky problem, and I'm not sure how best to address it. Volker and I have discussed it a bit, but need to look into details before we will be able to figure out what should be done.

I believe that aria-hidden is still needed in the explorer, as it is not the MathJax output itself that is being read by the screen reader, but the live region where the speech text is being placed that is read. You don't want the actual visual output to be read even during the explorer interaction, if I understand things correctly.

dpvc avatar Jan 14 '21 16:01 dpvc

I discussed this with Volker yesterday a bit and I think it might make more sense to discuss this F2F. In short, I'd suggest to let assistiveMML add tabindex="-1" to links in the visual output so that only the accessible (but visually hidden) link is reachable by keyboard; not great but fits the extension's approach.

It's trickier with the accessibility extension. I actually wouldn't expect problems with the live region since it should be read independently from everything else. I do see problems with the "static" markup. The container's aria-label doesn't indicate there's a link (and the explorer doesn't either when you're at the link, cf. https://github.com/zorkow/speech-rule-engine/issues/413; the explorer also doesn't let users activate links afaict). The link also won't have an aria-label so when a user tabs to it, they won't get anything, even with the accessibility extension on. It wouldn't hurt to add a label to the link I think - it shouldn't be read when a screenreader passes by in browse mode and the only weirdness would be when tabbbing (you'd focus the full expression first and then after that get to the link); I think that's acceptable. But I'd want to test that first.

As an aside, the mjx-container also doesn't have a role, in particular no role that permits an aria-label, which means the label might be ignored by AT (now, and even more so in the future once ARIA 1.2 is adopted).

pkra avatar Jan 15 '21 16:01 pkra

As an aside, the mjx-container also doesn't have a role, in particular no role that permits an aria-label, which means the label might be ignored by AT (now, and even more so in the future once ARIA 1.2 is adopted).

Talking to Volker, that's actually a bug. It should have role=application (which is sufficient).

pkra avatar Jan 15 '21 17:01 pkra

Talking to Volker, that's actually a bug. It should have role=application (which is sufficient).

=> https://github.com/mathjax/MathJax-src/pull/573

pkra avatar Jan 15 '21 19:01 pkra

I believe this is being addressed in mathjax/MathJax-src#1335.

dpvc avatar Aug 15 '25 14:08 dpvc