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

Test headings within sections #170

Open
pbb72 opened this issue Apr 14, 2021 · 3 comments
Open

Test headings within sections #170

pbb72 opened this issue Apr 14, 2021 · 3 comments
Assignees

Comments

@pbb72
Copy link

pbb72 commented Apr 14, 2021

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, w3c/html#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
Copy link
Contributor

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
Copy link

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
Copy link
Contributor

@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.

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

No branches or pull requests

3 participants