Problem/Motivation

When an editor uses the heading check to see an outline of their content, the headings on navigation blocks appear as part of the structure and there is not a current method to exclude them. These navigational headings appear even when the block is outside of the regions designated in "Check content in these containers" and when the block CSS selector is listed in "Skip over these elements". This is a problem if the editor skips levels because they might get the impression that the outline is fine even when they start with an h3.

For example, in the image below, the heading tag associated with the tabs block appears in the outline.

Screenshot of heading check

Steps to reproduce

Enable editoria11y and configure it to check a content region based on a CSS selector. Then add a block (tabs, menu, etc) that has an h2 title. Use the heading check feature.

Proposed resolution

Could we have a method to exclude via CSS selector any regions that we don't want to include in the heading structure?

CommentFileSizeAuthor
editoria11y_headings.png180.67 KBjastraat

Comments

jastraat created an issue. See original summary.

itmaybejj’s picture

Assigned: Unassigned » itmaybejj

That's irksome; I try to keep up with default selectors to knock out all those Drupal elements, but not every theme is the same. Could you share the DOM of that primary tabs instance? I'm curious to know why it's getting missed.

That said, try targeting the heading directly in "Skip over these elements" -- e.g., ".my-site-drupal-tabs-selector h2" or .my-site-drupal-tabs-selector *

jastraat’s picture

Hey @itmaybe, I already tried to add them to the "Skip over these elements" section. That removes those sections from being checked for accessibility issues, but does not remove them from the heading outline.

My guess is that's what your code to exclude standard elements is doing as well; the elements are not checked for accessibility but are still part of the outline.

<div id="block-my-theme-local-tasks" data-block-plugin-id="local_tasks_block" class="contextual-region block block-core block-local-tasks-block">
jastraat’s picture

Status: Active » Closed (works as designed)

Update: the "Skip over these elements" configuration option works if you use a wildcard to include all child elements. For example, to exclude the core local tasks block specified above along with its heading, use ".block-local-tasks-block *"

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

jastraat’s picture

(A big thanks to @itmaybejj; that's really going above and beyond as a maintainer.)

adriancooke’s picture

Woohoo! Adding my thanks @itmaybejj. Cc. @jastraat.

itmaybejj’s picture

Aww thanks.

For what it's worth the way you expected it to work is how it will work in 3.x.

Five years of other optimizations means the extra performance I got out of using very specific selectors is no longer measurable.