[whatwg] Question on (new) header and hgroup
mike at w3.org
Fri Jul 3 04:00:41 PDT 2009
Ian Hickson <ian at hixie.ch>, 2009-07-02 04:44 +0000:
> On Sat, 6 Jun 2009, Kornel Lesinski wrote:
> > The purpose of <hgroup> is to imply that <hx> is a subtitle. That's quite an
> > indirection. An explicit element would be easier to understand:
> > <h1>Dr. Strangelove</h1>
> > <subheader>Or: How I Learned to Stop Worrying and Love the Bomb<subheader>
> > [...]
> That would have been another option (it wouldn't handle multiple-level
> subheadings well, but that's not a big deal), but I'm not really convinced
> it's enough of an improvement to change the way the spec is written. It
> also has poorer graceful degradation behaviour, IMHO.
FWIW, I can think of at least one precedent for something similar
to <hgroup> in a markup language: the ISO 12083 standard, which
has a <titlegrp> element.
I would suspect there are probably a number of other markup
languages out there that have something like it as well.
So while it might be something unusual in the context of HTML as
it is now, it's not so unusual in the context of markup languages
Whether to use something like <hgroup> or something like an
explicit <subtitle> element is a document-modeling design choice
that needs to be made by weighing whatever the priorities are for
users and implementors (or producers and consumers) of the
language, and by looking at whatever the combination of advantages
and disadvantages the choice brings to the users and implementors
of the language.
In the case of HTML, having more graceful degradation behavior
seems like an important advantage.
And it seems like introducing a new element like <subheading>
would have the disadvantage of complicating the heading hierarchy
and confusing authors about when and where to use <subheading>
versus using <h2> to <h6>, and also requiring that the spec detail
how to deal with cases like, e.g.:
...or whatever. Yeah, we could spec the document-conformance rules
to disallow weird <h2>-<h6>/<subheading> combinations, but even
then, the spec would have to state what UAs are supposed to do
when authors don't follow the rules and throw in weird,
non-conformant combinations anyway.
So, on balance, <hgroup> seems like it hits the sweet spot pretty
well, as far as providing something that meets the various
requirements (e.g., a means to associate headings with
subheadings, without causing an inordinate amount of confusion to
authors, and without adding an inordinate amount of processing
complexity for implementors).
More information about the whatwg