accessibilitysupported / a11ysupport.io

Accessibility Support data for various HTML, ARIA, CSS, and SVG features
https://a11ysupport.io/
Other
282 stars 33 forks source link

Test headings within sections #170

Open pbb72 opened 3 years ago

pbb72 commented 3 years ago

The WHATWG HTML5 spec allows placing headers (h1-h6) inside nested sections, functionally lowering the header level.

So the following code:

<body>
 <h1>Apples</h1>
 <p>Apples are fruit.</p>
 <section>
  <h1>Taste</h1>
  <p>They taste lovely.</p>
 </section>
</body>

...is semantically equivalent to:

<body>
 <h1>Apples</h1>
 <p>Apples are fruit.</p>
 <h2>Taste</h2>
 <p>They taste lovely.</p>
</body>

Relevant section in WHATWG spec: https://html.spec.whatwg.org/multipage/sections.html#headings-and-sections

Note that the W3C spec has removed this: https://www.w3.org/TR/html52/sections.html#headings-and-sections, https://github.com/w3c/html/issues/169

Would it be possible to create a test for support of this by screenreaders and other accessibility tools? (I saw some claims that JAWS has support for this.)

mfairchild365 commented 3 years ago

Hi @pbb72 - yes, I think it would be good to test this. I'm not aware of any browser/at that currently supports this, and I highly doubt that it will ever be supported. However, having tests and data that prove that it isn't supported would be good.

andypillip commented 3 years ago

I just read about this again this week, and it was removed in HTML 5.2 because no major browser managed to implemented it. They tried, but couldn't make it work due to many regressions.

The only thing FF implemented, was styling that would make these section-headlines look like their equivalent, but the document outline never changed.

Accessibility folks seem to agree that the way to go are h1–h6 elements.

mfairchild365 commented 3 years ago

@andypillip that's correct. However, it is probably worthwhile to point out the W3C's HTML 5.2 spec is no longer a thing and has been replaced by the WHATWG HTML living standard, which still has this language. h1-h6 elements are indeed the way to go.