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 landmarks, use semantic html tags to admin templates #5290

Merged
merged 7 commits into from May 14, 2019

Conversation

hippogriffic
Copy link

@hippogriffic hippogriffic commented May 10, 2019

Fixes #5275.

@squash-labs
Copy link

squash-labs bot commented May 10, 2019

Manage this branch in Squash

Test this branch here: https://hippogrifficadd-semantic-tags-19exs.squash.io

Copy link
Member

@thibaudcolas thibaudcolas left a comment

Choose a reason for hiding this comment

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

Great to see this happening! I've added a question about usage of aside, and this will need to add support for translations when using aria-label. I'm really happy to see the updated tabs markup, at the moment I think tabs are completely hidden from screen reader users.

There are some things that are not in the PR and I'd like to propose for inclusion:

  • role="banner" for current usage of the header element, to maximise support by screen readers
  • role="contentinfo" for current usage of the footer element
  • Would there be a case for using the footer tag in other places, with role="contentinfo"?
  • Looking at the list of landmark roles in https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques#Landmark_roles, are there places where we could be using role="region" with a label, for regions that are very common in Wagtail?

Finally, I think we've discussed that already but @hippogriffic could you confirm that IE11 support isn't an issue for this?

Edit: I see this is making some of the tests fail in CI, presumably because they rely on the markup. Could you have a look at those failures?

@thibaudcolas thibaudcolas added this to the 2.6 milestone May 10, 2019
@thibaudcolas thibaudcolas added this to In progress in WCAG2.1 & ATAG 2.0 for CMS via automation May 10, 2019
@hippogriffic
Copy link
Author

I'm not sure I see a lot of need for more footer elements anywhere, there's doesn't seem to be an obvious use for them. Same with section, I haven't been able to spot anywhere that seems to be lacking this landmark but if you had specific instances in mind please let me know.

IE11 support should be fine with these changes

Copy link
Member

@thibaudcolas thibaudcolas left a comment

Choose a reason for hiding this comment

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

Looks good! I have tested this in IE11 for browser support, Chrome with VoiceOver for the screen reader impact, as well as Axe.

I ended up adding some of the landmarks to more instances of how they had been added here – main for content-wrapper, the banner for header elements and contentinfo for footer, as well as navigation for the pagination UIs.

{% for child in self.children %}
<li class="{{ child.classes|join:" " }} {% if forloop.first %}active{% endif %}"><a href="#tab-{{ child.heading|cautious_slugify }}" class="{% if forloop.first %}active{% endif %}">{{ child.heading }}</a></li>
<li id="tab-label-{{ child.heading|cautious_slugify }}" class="{{ child.classes|join:" " }} {% if forloop.first %}active{% endif %}"><a href="#tab-{{ child.heading|cautious_slugify }}" class="{% if forloop.first %}active{% endif %}">{{ child.heading }}</a></li>
Copy link
Member

Choose a reason for hiding this comment

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

@@ -23,7 +23,7 @@ <h1 class="icon icon-doc-empty-inverse">
<input type="hidden" name="next" value="{{ next }}">
{{ edit_handler.render_form_content }}

<footer>
<footer role="contentinfo">
Copy link
Member

Choose a reason for hiding this comment

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

Axe complains about https://dequeuniversity.com/rules/axe/3.2/landmark-contentinfo-is-top-level?application=axeAPI. I still think this is valuable though, so will leave it for now.

@thibaudcolas thibaudcolas merged commit 70a749b into wagtail:master May 14, 2019
WCAG2.1 & ATAG 2.0 for CMS automation moved this from In progress to Done May 14, 2019
@thibaudcolas
Copy link
Member

Merged! Thank you @hippogriffic, this will be released in Wagtail v2.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Define more ARIA landmarks in the CMS admin
3 participants