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

Add support for WCAG 2.1 SC 2.2.2: Handling of animated GIFs #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

otacke
Copy link
Contributor

@otacke otacke commented Feb 15, 2023

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

  • try to compute a static GIF image as a replacement which may fail for cross-origin reasons or on iOS devices that impose limitations,
  • use a static canvas dressed as an image for screen readers as a replacement for the animated GIF,
  • add a button to toggle between the animated GIF and the static replacement in the upper right corner,
  • keep the animation off by default, and
  • add an option to the editor that allows authors to explicitly express that an animated image is essential.

There may be things to discuss, e.g.

  • Should this be stricter and not even wait for the prefers-reduced-motion query to match?
  • Should the animation start automatically but stop after 5 seconds (restartable using the button) as suggested in https://www.w3.org/WAI/WCAG21/Techniques/general/G152.html
  • Is the 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?
  • ...

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 this pull request may close these issues.

1 participant