WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: landmarks/regions

for

From: Jon Gunderson
Date: Oct 13, 2021 4:22PM


The header and footer elements only generate landmarks when they are in a
certain contexts of a web page (e,g, scoped to body element), see ARIA
Authoring Practices for more information on using HTML elements to create
landmarks:

Guidance URL:
https://w3c.github.io/aria-practices/#aria_landmark

Example URL:
https://w3c.github.io/aria-practices/examples/landmarks/index.html

Another document that defines the roles of the the W3C ARIA in HTML
document has specifications for the HEADER and FOOTER elements:
https://www.w3.org/TR/html-aria/

Hope this helps,
Jon



On Sat, Oct 9, 2021 at 4:14 PM glen walker < <EMAIL REMOVED> > wrote:

> >
> > What surprised me the most is that headers and footers were not
> > automatically landmarks.
> >
>
> Just to clarify, the header and footer elements are absolutely (*) landmark
> roles by default. Now, whether the verbosity setting on your screen reader
> is set to announce them is another issue but any tool you use to highlight
> all the landmarks will show the header and footer elements.
>
> (*) Ok, maybe not "absolutely" because if a header or footer is a child of
> an article, aside, main, nav or section element, then the header or footer
> does not have a role (https://w3c.github.io/html-aria/#el-header). I
> don't
> see that structure very often, though. Most scanning tools don't honor the
> spec even though the accessibility tree is correct (at least in Chrome and
> Firefox). That is, scanning tools will complain that there are two heading
> landmarks if you have something like this:
>
> <header>stuff</header>
> <article><header>more stuff</header></article>
>
> Even though the second header is marked as "role: HeaderAsNonLandmark" in
> the a11y tree.
>
> Keep preaching semantic html.
> > > > >