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

Provide more semantic structure for screen-readers #9358

Merged
merged 2 commits into from Jul 6, 2021

Conversation

jonels-msft
Copy link
Contributor

Subject: Fix menu narration for sceen-readers

Feature or Bugfix

Accessibility bugfix

Purpose

The use of <p> for submenu captions lacks semantic information. Screen-readers don't narrate the menu correctly. This PR adds role="heading" to the caption as an ARIA landmark.

Detail

I don't yet know how to test my changes locally, so there may be errors. Please advise if I got it wrong.

Relates

Fixes #8989

Accessibility technique described in https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA12

@astrojuanlu
Copy link
Contributor

Looks like test_html_meta has failed, this line needs to be changed:

sphinx/tests/test_intl.py

Lines 625 to 626 in 13d59bc

expected_expr = '<p class="caption"><span class="caption-text">HIDDEN TOC</span></p>'
assert expected_expr in result

@jonels-msft
Copy link
Contributor Author

@astrojuanlu thanks for the tip, I updated the test

Copy link
Contributor

@astrojuanlu astrojuanlu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jonels-msft !

@jonels-msft
Copy link
Contributor Author

@astrojuanlu cool, do we need someone else to review too, or is this good to merge?

@astrojuanlu
Copy link
Contributor

@jonels-msft this looks good to me but a Sphinx maintainer needs to review it. Also, someone has to approve the pipelines to run, to verify that we are not missing anything.

@tk0miya tk0miya added this to the 4.1.0 milestone Jul 6, 2021
Copy link
Member

@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late. LGTM!

@tk0miya tk0miya merged commit 7bd4603 into sphinx-doc:4.x Jul 6, 2021
@tk0miya
Copy link
Member

tk0miya commented Jul 6, 2021

Merged. Thank you for your contribution!

tk0miya added a commit that referenced this pull request Jul 6, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Table of contents items not associated with their headers
3 participants