Add support for WCAG 2.1 SC 2.2.2: Handling of animated GIFs #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The WCAG 2.1 defines a success criterion for pausing/stopping/hiding of moving, blinking, scrolling or auto-updating elements that are not essential (https://www.w3.org/WAI/WCAG21/Understanding/pause-stop-hide). That definition applies to animated GIFs, and the WCAG describes a suggestion for a technique to meet the success criterion (https://www.w3.org/WAI/WCAG21/Techniques/general/G152.html).
H5P.Image allows users to upload and display animated GIFs. The responsibility for not using animated GIFs at all could be delegated to the author. Here's a suggestion for direct support, really just a suggestion because some things certainly would require discussion.
The suggestion presented here will do nothing if
Otherwise, the suggestion will
canvas
dressed as an image for screen readers as a replacement for the animated GIF,There may be things to discuss, e.g.
prefers-reduced-motion
query to match?boolean
override field in the editor that allows authors to explicitly express that an animated GIF is essential in order to bypass the whole shebang necessary?-What about images that are not added via H5P.Image but H5P core's image widget? Should this be treated similarly incl. moving some of the new functions here into H5P core and allow content types that make use of the internal widget to use them?