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

Fix fallback logo so Chrome will not flag it to screen readers #1724

Conversation

NickColley
Copy link
Contributor

@NickColley NickColley commented Feb 5, 2020

role="none"/"presentational" does not do enough to hide the child fallback image used in older browsers.

We have found that Chrome's new "Get image descriptions from Google" feature will notice this fallback image.

This means when screenreaders such as NVDA visit the logo, it'll announce "Unlabelled graphic, To get missing image descriptions, open the context menu." for this fallback image.

By using aria-hidden="true" we can ensure that the SVG and it's children are all hidden from the accessibility tree, which I have confirmed in NVDA + Chrome.

I have also made this change to the other places we're using role="presentation" in this way for consistency.

Closes #1636

role="none"/"presentational" does not do enough to hide the child fallback image used from browsers.

We have found that Chrome's new "Get image descriptions from Google" feature will notice this fallback image.

This means when screenreaders such as NVDA visit the logo, it'll announce "Unlabelled graphic, To get missing image descriptions, open the context menu." for this fallback image.

By using aria-hidden="true" we can ensure that the SVG and it's children are all hidden from the accessibility tree, which I have confirmed in NVDA + Chrome.

- [Get image descriptions on Chrome](https://support.google.com/chrome/answer/9311597?hl=en)
- [The Difference Between role=”presentation” and aria-hidden=”true”](https://timwright.org/blog/2016/11/19/difference-rolepresentation-aria-hiddentrue/)
Where possible we should use aria-hidden="true" instead of role="none"/"presentation", this is mainly for consistency with the header component where aria-hidden="true" ensures child elements are hidden as well which is not a problem with the button and footer component.

- [The Difference Between role=”presentation” and aria-hidden=”true”
](https://timwright.org/blog/2016/11/19/difference-rolepresentation-aria-hiddentrue/)
@36degrees
Copy link
Contributor

Makes sense to me, thanks Nick 👏 How confident are you that this will work consistently everywhere? Do you think we need to test this change across all of the assistive technologies we support?

@NickColley
Copy link
Contributor Author

@36degrees I have not done a full run through testing with all assistive technologies and browsers as I have confidence that this aria attribute has very broad support and we use it elsewhere (for example the accordion component).

I can do some testing soon to double check.

@NickColley
Copy link
Contributor Author

@36degrees I've tested this in JAWS, NVDA in Edge, Chrome, IE11, Firefox and VoiceOver in Safari and it dont hear any icons being announced when tabbing to the GOV.UK link in the header.

@36degrees
Copy link
Contributor

If you're confident with the changes to the other components as well then I think this is good to merge 👍

@NickColley
Copy link
Contributor Author

@36degrees I also tested the start link button

@NickColley NickColley merged commit 0af4741 into master Feb 10, 2020
@NickColley NickColley deleted the fix-fallback-logo-being-detected-by-chromes-image-description-feature branch February 10, 2020 13:01
@NickColley
Copy link
Contributor Author

NickColley commented Feb 10, 2020

Needs a changelog entry, will follow up.

NickColley added a commit that referenced this pull request Feb 10, 2020
NickColley added a commit that referenced this pull request Feb 10, 2020
@hannalaakso hannalaakso modified the milestones: Next, v3.6.0 Mar 3, 2020
@36degrees 36degrees mentioned this pull request Mar 6, 2020
andymantell added a commit to surevine/govuk-react-jsx that referenced this pull request Mar 6, 2020
36degrees added a commit to alphagov/govuk-design-system that referenced this pull request May 14, 2020
The markup for the header was changed in alphagov/govuk-frontend#1724:

> role="none"/"presentational" does not do enough to hide the child fallback image used in older browsers.
>
> We have found that Chrome's new "Get image descriptions from Google" feature will notice this fallback image.
>
> This means when screenreaders such as NVDA visit the logo, it'll announce "Unlabelled graphic, To get missing image descriptions, open the context menu." for this fallback image.
>
> By using aria-hidden="true" we can ensure that the SVG and it's children are all hidden from the accessibility tree, which I have confirmed in NVDA + Chrome.

This change went out as part of GOV.UK Frontend v3.6.0. It was missed when updating the Design System to use v3.6.0 in #1187 (it's a non-breaking change, as the existing markup works fine – this is just an improvement)
@vanitabarrett vanitabarrett changed the title Fix fallback logo being detected by chromes image description feature Fix fallback logo so Chrome will not flag it to screen readers Sep 28, 2021
@vanitabarrett vanitabarrett mentioned this pull request Dec 15, 2021
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.

'Unlabelled graphic' read out within header using NVDA
5 participants