Intent to prototype: heading levels

172 views
Skip to first unread message

Anne van Kesteren

unread,
Oct 16, 2019, 9:51:50 AM10/16/19
to dev-platform
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.
(https://annevankesteren.nl/2019/10/heading-levels 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).

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=998590.

Standard: https://github.com/whatwg/html/pull/3499 coupled with
https://github.com/whatwg/html/issues/5002.

Platform coverage: All.

Preference: accessibility.heading-element-level-changes.enabled.

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.

Anne van Kesteren

unread,
Nov 13, 2019, 10:20:04 AM11/13/19
to dev-platform
Unfortunately, this was not a success (too many h1s got adjusted to be
h2s) so we've removed this code and abandoned this particular plan for
dealing with heading levels in HTML:
https://bugzilla.mozilla.org/show_bug.cgi?id=1590366.
Reply all
Reply to author
Forward
0 new messages