A polyfill for a proposed HTML Standard "outline algorithm".
The basic gist of the proposal is as follows:
- Focus on headings alone and leave landmarks to their own UI.
h2
-h6
always have heading level 2-6, unless their parent ishgroup
, in which casehgroup
is the heading andh2
-h6
are just content.h1
andhgroup
have heading level 1 + the number of ancestor sectioning content / sectioning root elements. (We include sectioning roots as it seems sensible that a h1 inside a blockquote should have a higher level than the one in the section or article the blockquote is in. A wrinkle here is that sectioning roots are not considered by the rendering section at the moment.)hgroup
presents itself as a heading (role=heading
) and itsh1
-h6
children as ordinary content (no role, like span).
Motivation can be found in HTML Standard issue 83.