[whatwg] <hgroup> functionality absorbed into <header>?

Oli Studholme whatwg.org at boblet.net
Sat Oct 3 01:26:38 PDT 2009


Hi All,

In talking with authors about HTML5 <hgroup>[1] I’ve found it seems
confusing for many people, and I’ve also found it a little difficult
to explain so it’s easy to understand (conversation = why? outline
algorithm. huh?). Currently it’s only role is to hide subheadings from
the outline algorithm and it doesn’t map to a common use pattern for
adding semantic meaning. There doesn’t seem to be any tangible benefit
to authors in using it.

Superfriends suggested a Boolean attribute for <header> to determine
if all child <h1>-<h6> elements are included in the outline[2]. The
current <hgroup> model excludes all subtitles from the outline.
Assuming that subtitles should not be included in the outline (eg to
make sure the highest-ranked title is indeed descriptive), what if
<header> by default masked subtitles from the outline algorithm as
<hgroup> currently does? This would mean <hgroup> is no longer
necessary, and make <header> less optional (it currently feels like
solely a CSS hook from an author perspective).

Currently #the-header-element[3] mentions a “Little Green Guys With
Guns” example in which <h1>-<h6> elements in the <header> but outside
<hgroup> create implied <section> elements via the outline algorithm.
If <header> hides all but one <h1>-<h6> element this won’t happen
(this is also a potential issue with the Boolean attribute idea).
While the spec states authors should add wrapping <section>s I suspect
many won’t bother and rely on implied ones (unless they need CSS
hooks). This would also be potentially confusing compared with
<footer>, and possibly encourage authors to mistakenly add <section>s
with <header>s inside of a <header> (copy&paste mistakes etc).

While this idea has drawbacks I feel <hgroup>’s lack of tangible
author benefit and ‘occasional use’ nature will result in it not being
widely used when it should be. I’d like to hear your opinion on both
this idea and the Superfriends Boolean attribute idea (which I haven’t
found discussed in the list).

Thanks for your time
peace - oli

PS note <section> elements implied by the outline algorithm aren’t
present in the DOM and so are not styled (thanks @vant)

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-hgroup-element
[2] http://www.zeldman.com/superfriends/guide/#hgroup
[3] http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-header-element



More information about the whatwg mailing list