Scripting in EPUB 3
Scripting in EPUB 3 should be considered an optional feature, and the main content of the book should be understandable without scripting. According to IDPF:
"when the document is rendered by a Reading System without scripting support or with scripting support disabled, the top-level document content must retain its integrity, remaining consumable by the User without any information loss or other significant deterioration."
Using a similar approach to handling embedded media, the following are recommendations on dealing with scripted content in EPUB 3:
- Scripted content should not contain information that is critical to understanding the material.
- If the scripted content is critical, a suitable alternative should be provided. For example, an alternative to a scripted quiz would be a an answer key.
- Scripted content can also benefit from a synopsis so users can gain an understanding without having to run the script. This is particularly useful for reviewing material for study, or for situations where time constraints or the environment hinder the ability to interact with the script.
- Interactables contained in
<canvas>elements should have transcripts, answer keys / solutions, etc. Use
aria-describedbyto properly associate any canvas alternatives to the canvas itself.
- Consider adding keyboard accessibility by ensuring all interactable components can be focused using the keyboard. This can be tested by using the tab key to navigate through the EPUB content and the embedded script.
- The HTML that accompanies a script should be as standard compliant as possible and follow established best practices for HTML markup. This helps improve the likelihood that your script is understood by assistive technologies such as screen readers.
- <a rel="nofollow" target="_blank" class="link-external"href="http://www.idpf.org/accessibility/guidelines/content/script/pe.php" rel="nofollow">"EPUB 3 Accessibility Guidelines: Scripted Interactivity - Progressive Enhancement" by IDPF.
- "EPUB 3 and Interactivity", by Liza Daly, EPUB Zone.