Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

role="math" on images #523

Open
gregoriopellegrino opened this issue May 29, 2024 · 4 comments · May be fixed by #525
Open

role="math" on images #523

gregoriopellegrino opened this issue May 29, 2024 · 4 comments · May be fixed by #525

Comments

@gregoriopellegrino
Copy link

Analyzing some legacy EPUB files with mathematical formulas inserted as images, we realized an inconsistency between the ARIA and HTML-ARIA specifications.

The WAI-ARIA 1.2 specification provides an example of using role="math" on an <img> element to indicate that it represents a mathematical expression:

<img role="math" src="..." alt="x=⟮−b±√⟮b²−4ac⟯⟯÷2a">

However, according to the ARIA in HTML specification, the math role is not allowed on <img> elements. This discrepancy between the two specifications has led to confusion and inconsistent validation results.

The EPUBCheck validator reports an error when encountering role="math" on <img> elements, as it follows the ARIA in HTML specification (w3c/epubcheck#1562 (comment)).

@gregoriopellegrino
Copy link
Author

To add some context, I bring you a use case in digital publishing.

Many publishers are currently working to remediate legacy content, primarily in EPUB 2 format, to make it accessible. For years, support for mathematical formulas in MathML was not well implemented in reading applications and was not supported by the digital format itself (EPUB 2). As a result, mathematical formulas were often inserted as images.

Now, in the process of making large quantities of publications accessible, managing mathematical formulas presents a significant challenge. Allowing the use of role="math" on an image containing a formula, while inserting the textual description of the formula in the alt attribute, could be extremely useful.

This approach would enable publishers to quickly improve the accessibility of vast catalogs of mathematical content, while providing a richer reading experience for all users.

It's important to note that for new publications, publishers are already working with MathML to ensure optimal accessibility and representation of mathematical content. However, the ability to use role="math" on images would significantly aid in the process of making legacy content more accessible, bridging the gap between older formats and modern accessibility standards.

@gregoriopellegrino
Copy link
Author

cc @mcking65 @jnurthen

@gregoriopellegrino
Copy link
Author

@scottaohara
Copy link
Member

apologies for the long delay in responding. but yah, this seems a miss. while not ideal to use images, as the ARIA spec notes, legacy content might need it - so it should be allowed. now, that might then fail other wcag related rules (images of text, for instance) but that's out of the scope of this spec to limit.

scottaohara added a commit that referenced this issue Jul 17, 2024
closes #523

includes allowance of `role=math` on `img` elements.

Per the ARIA specification:
>While it is not ideal to use an image of a mathematical expression, there exists a significant amount of legacy content where images are used to represent mathematical expressions. Authors SHOULD ensure that images of math are labeled by text that describes the mathematical expression as it might be spoken.

so this role should be allowed for such instances, and any further accessibility gaps caused by the use of the img element would be for authors to resolve beyond the scope of what this spec covers.
@scottaohara scottaohara linked a pull request Jul 17, 2024 that will close this issue
4 tasks
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 a pull request may close this issue.

2 participants