Re: suggestion for abolition of <hgroup>

Bruce Lawson, Thu, 02 Dec 2010 20:15:59 +1000:

> <h1>BruceLawson.co.uk</h1>
> <h2 subtitle>Gorgeousness in a gimp mask</h2>

> […] you're putting the attribute on the thing that you want 
> affected, rather than around it and some other stuff. And the word 
> "subtitle" does what it says on the tin.

Here is a proposal witout the disadvantats that James mentioned:

<hgroup> really is a kind of list container, where only one of its list 
items are (outline) signficant. The authors' most important problem 
lays in undestanding that it is, in fact, a list format: A heading 
element which is a list is a new thing. To, subsequently, understand 
that only one of the list items are used outlines, is then simpler to 
understand.

How could we make this simpler to grasp for authors? Like so:

1) expand the possible list items to also include <p>, 
2) change the name from <hgroup> to <heading>.
   
This also allows to have a generic heading element:

 <heading><p>Lorem ipsum.</p></heading>

If, for back-compat reasons we find that a single <p> _alone_ should 
not be permitted, then can disallow that, for now. And allow it later 
on, when UAs have catched up.

Summary of the proposal:

      Name: <heading>
   Content
     model: * Permitted content: <p> and h1-h6 elements.
            * Must contain: 1 or more of the permitted elements;
            * Two variants:
              # Generic: <heading><p> Lorem </p></heading>
                         (with 1 or more <p> elements inside)
              # Subtitled: contains 1 ore more h1-h6 elements
                           and zero or more <p> elements
Occurrence: * Generic: only permitted in <section> & <article>
            * Subtitled: everywhere h1-h6 elements are permitted
   Outline: * the first, highest ranking element is used. When 
              a generic <heading> has 2 or more <p> elements,
              then the first <p> is used.

Comments:

* By naming the element <heading>, it's clear that "this is a
  heading". (By contrast, the name "heading group" does not 
  offer much help for interpretation at all.)
* By allowing <p> as the only content, we have a generic header.
* The fact that <heading><p>foo</p></heading> will be seen as a
  paragraph by legacy browsers is useful.
* Legacy user agents as well as screen readers, can automatically
  cope with something like this:
  <heading>
    <h1>Main heading</h1>
    <p>Sub title</p>
  </heading>
* By limiting the use of the generic variant to <section> and 
  <article> we mildly encourage use of those elements. 
* By not allowing the generic variant outside <section> and 
  <article> we make sure that <heading> can be interpreted in a
  meaningful way by legacy user agents.
* The subtitling "act" becomes more logical: To have a subtitle,
  one must also have something which is *not* a subtitle, namely
  a h1-h6  element. 
* Inside a <section> element, <heading><h1></h1></heading> and 
  <heading><p></p></heading> would have the same semantics.

Leif Halvard Silli

Received on Thursday, 9 December 2010 12:38:40 UTC