forumone / gesso

Gesso Drupal theme
67 stars 13 forks source link

Remove role="group" from <figure> #804

Closed kmonahan closed 6 months ago

kmonahan commented 7 months ago

Outside accessibility review reported "A figure with a figcaption must not have a role attribute." Currently, we assign role="group" if a caption is present.

Based on what I'm finding, they're correct and we should only apply role="group" if the figure contains multiple related images that each have their own caption. I do see that in https://www.w3.org/WAI/tutorials/images/groups/#a-collection-of-images, the individual figures also have the role of group, but the text definitely implies that's for a group of images, and adding a role of group overrides the default role of figure. (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/figure_role)