Summary: The HTML Standard has for the longest time defined a feature
whereby you could exclusively use the h1 and sectioning elements, and
user agents would take care of adjusting the heading level according
to the nesting depth. Due to the complexity it never got adopted.
There’s an alternative proposal that amounts to counting sectioning
element ancestors for h1 elements only (and h2-h6 if their parent is
hgroup), which is much more doable performance-wise. That proposal
might see some further refinements for behavior around hgroup, based
on discussion in the issue linked below.
goes into the
high-level idea a bit more.)
The idea is to ship this by default on Nightly and maybe Dev, but not
ride the trains (until the standard is more fully agreed and there's
an intent to ship).
Platform coverage: All.
DevTools bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1588784
Other browsers: Have expressed mild interest to get to it eventually,
us having some code hopefully gets them more fully on board.
web-platform-tests: Unclear how to test heading levels, but once
there's a corresponding CSS pseudo-class to expose them there will be.
Secure contexts: No, bifurcating an existing HTML feature like that
doesn’t seem like a good idea.
Is this feature enabled by default in sandboxed iframes? Yes.