Skip to content

Alternative take on hgroup #5002

@annevk

Description

@annevk

#3499 got quite a few comments, mostly from @sideshowbarker (and at w3c/html-aam#123 from @stevefaulkner), about hgroup.

I've been thinking about this slight change to compute headings and heading levels to address the concerns raised:

  • hgroup is no longer a heading itself. It becomes a container that can influence heading levels. (It has no level itself.)
  • To determine the level of an h1 element, return the number of ancestor sections + 1 (as per current PR).
  • To determine the level of an hN element whereby N is in the range 2 to 6, inclusive: if parent is hgroup, then return the number of ancestor sections + N; otherwise, if parent is not hgroup, return N.

I think this would also be in line with the existing way these elements get rendered when used in combination and how hgroup is typically used.

cc @whatwg/a11y

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions