-
Notifications
You must be signed in to change notification settings - Fork 346
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
Draft guidance to help authors understand the difference between landmark regions and outline sections #575
Comments
The following comments were placed in w3c/aria#696. In order to ensure that role-parity issues stay focused on role-parity, and ARIA issues stay focused what is specific to ARIA, I am moving them here as the closest, open issue. @carmacleod said:
@mcking65 responded:
@carmacleod said:
|
Thank-you, @joanmarie ! |
@carmacleod, very, very well said!! In addition to cleaning up specs, it seems that guidance on this should be part of the APG. Should I change this issue into the to-do for drafting that guidance? |
Yes, please, @mcking65 ! |
I've been pondering the one sticking point, which is that a section element with aria-labelledby pointing to a heading will end up being in both the outline and the list of landmarks. To walk through how common this problem would be, please imagine the following scenario:
At this point, they have a well-defined region. Unfortunately, they also have a well-defined section that will most definitely show up in the outline, which is not what they intended. This is the sticking point that I keep coming back to, and it is the reason, I think, for a lot of the confusion around sections, regions, headings, and outlines. I can think of 2 possible ways out of this conundrum. The first is to specify that if a section element has an (aria-label or) aria-labelledby attribute, then it MUST NOT show up in the outline. There are a couple of reasons why I don't like this idea:
The other way to clear up things immensely is to create a new role. Let's call it "outline", and let's make "outline" be the default role for section elements, instead of "region". If we do this, then I think the author's intent can be completely clear:
One other beautiful result of creating a new "outline" role is that the first heading child of a section can be a part of the accessible name calculation for the section, whether it has role="outline" or role="region". This would work because the semantics for each section element would be crystal clear without needing to use the aria-label or aria-labelledby attribute as part of the role. Of course, the obvious down side is that it's not backward compatible. Anyone who relied on section-with-accessible-label=region would need to go back and add role="region" to their sections in order to get their landmark regions back. I would argue that the current spec is so convoluted that authors aren't always getting what they expect anyhow. Another complication is... which elements would we allow role="outline" on? Section, obviously (default - do not set). But what about div? span? Maybe. This could complicate the already-complicated rethink of the outline algorithm. However, taking region landmarks out of the outline may also simplify the outline algorithm, at least from the point of view of AT. @mcking65, what do you think? |
Happened to notice a trend in the WebAIM Screen Reader User Survey results: the use of landmark navigation is decreasing.
If I had to guess why, I would say that it is most likely because landmarks are inconsistently implemented, and often over used. I would further guess that the lack of clarity in the spec(s) is contributing to this problem. In Survey 5, an additional question was asked: how many landmarks is optimal? The typical answer was 4 - 6. This was before the introduction of html5 section elements and the region role. My best guess for today would be that the optimal number would be 4 - 8 (header, nav, main, footer, maybe a search, maybe an aside or two, or a region or two, maybe another nav, or a form). I don't see this "rule of thumb" for the number of landmarks actually mentioned anywhere in the specs (HTML spec, ARIA spec, APG). There's no indication that having too many landmarks can effectively render them useless to the users who could benefit from them. We should at least add a note to that effect in the landmarks section of the APG, and maybe even repeat it in the section on region landmark. Edit: Number and type of landmarks on some popular home pages:
|
I suppose that a third way out of the conundrum mentioned previously is to simply not care if some landmarks end up in the outline. For example, as things currently stand, the following landmark will end up in the outline:
And the following landmark won't be in the outline (at least, I don't think so, because it doesn't have a heading, although the outline algorithm seems to be getting a complete rewrite, so I'm not sure):
And maybe that's ok? @mcking65 What do you think? |
Just a heads-up that the proposed whatwg outline algorithm rewrite advises against having a section element without a heading. The following quote is from the section about the section element:
And the following quote is from the almost completely rewritten section on Headings and Sections:
(That sentence is a real doozy - I've asked them to simplify it - but I believe it is trying to say "no sections without headings). Another heads-up: they are going back to trying to make |
Interesting. The HTML-AAM mapping for a section element without an accessible name has been changed to be the same as This doesn't really affect the scenario in #575 (comment), which is summarized as:
The above still defines both a landmark region (because the section element has an accessible label), and an outline section (because of the heading). I don't know whether that matters. We'll probably have to wait and see whether the outline algorithm mess is ever cleaned up. The only way to remove sections from the outline would be to explicitly prune any that have an accessible label, but I don't think that's currently on the table. I don't know what authors' or users' expectations would be in this case. |
Noticed that the APG example code for region landmark includes the following HTML Technique: <section aria-labelledby="region1">
<h2 id="region1">title for region area 1</h2>
... content for region area 1 ...
</section> Perhaps this should be rewritten to use a span for the region's name, and not an h2? |
I think that is wrong for a number of reasons:
I would also close the NVDA ticket as I think that NVDA outputs the example correctly. |
I don't have the required github permissions to reopen issue #562 (only repo collaborators can reopen issues that they have closed). So I am opening this new issue in order to discuss #562 (comment).
I think we need to clarify what it means to use a section element without a label. If we can't come up with a good description of what an unlabelled section element is useful for, then I think its use should be discouraged.
Please also read:
section
should be identified, typically by including a heading (h1
-h6
element) as a child of thesection
element."The text was updated successfully, but these errors were encountered: