Closed ptsefton closed 9 years ago
I am intimately familiar with HTML's rules for headings.
One thing you'll note is that the very section you link to has a pretty strong warning: "There are currently no known implementations of the outline algorithm in graphical browsers or assistive technology user agents, although the algorithm is implemented in other software such as conformance checkers. Therefore the outline algorithm cannot be relied upon to convey document structure to users. Authors are advised to use heading rank (h1-h6) to convey document structure."
If you look through the spec, you will not find that many warnings. It's a strong indication that something is amiss. That section is essentially not implemented and there is strong dissent around it. It is only there because there was no consensus to remove it — but I really would not recommend relying on it for anything.
The problems don't stop there. There is actually no consensus on the proper usage of heading elements. The W3C and WHATWG versions of HTML differ on:
hgroup
to group headings (possible vs deprecated)h1
-everywhere vs depth-dependent element names).header
element for sectioning information in an outline.main
participates in the outlining (and generally how it works to convey the main content of the document).(I could be missing a few differences, I've been actively trying to forget all of this; but a quick look through Spork seems to match my recollection.)
In fact, heading is arguably one of the worst points of contention in HTML semantics. The last thing I want is for SH to be caught in the crossfire of a W3C-WHATWG discussion on semantics (or anyone for that matter, it's a very unpleasant place to be as I unfortunately know too well). Defining rules that ascribe usable, (I hope) sensible usage patterns and semantics to headings is IMHO necessary in this instance.
See https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Sections_and_Outlines_of_an_HTML5_document
And: http://www.w3.org/TR/html5/sections.html#outlines
HTML 5 already has rules for outlines - suggest you use these.