w3c / html-aria

ARIA in HTML
https://w3c.github.io/html-aria/
Other
178 stars 48 forks source link

role="math" on images #523

Open gregoriopellegrino opened 1 month ago

gregoriopellegrino commented 1 month ago

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 (https://github.com/w3c/epubcheck/issues/1562#issuecomment-2125411017).

gregoriopellegrino commented 1 week ago

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 commented 6 days ago

cc @mcking65 @jnurthen

gregoriopellegrino commented 6 days ago

cc @clapierre @avneeshsingh @GeorgeKerscher