Re: Use cases for <hgroup> ? [WAS] revisiting <hgroup> in HTML

Steve Faulkner, Thu, 7 Mar 2013 09:29:41 +0000:

>
> can you or anyone provide  use cases for <hgroup> that
> are not covered by existing markup?
>

Let me hear if the following use cases satisfies you:

1) Auxiliary headings are a fact, whether marked up or not:
   http://en.wikipedia.org/wiki/Subtitle_(titling)
   They are today distinguished via punctuation and line breaks.
   In HTML, we use 1) CSS styling, 2) <h1>Main<br>Auxiliary</h1>,
   3) <h1>Main</h1><h2>Aux.</h2> or 4) <h1>main</h1><p>Aux.</p>.

2) Today’s cow paths (<h1>+<p>, <h1>+<h2>, <h1><br></h1>) do not
   convey the 'auxiliary heading' semantics to consumers and, with
   exception of <h1>+<p>, they do not allow us to avoid that the
   auxiliary headings are represented standalone or mixed with the
   main part of the heading in outlines and ToCs. E.g. to query
   above cowpath solutions for their auxiliary headings, brings
   nothing. Semantic aux. headings would let us separate headings
   & auxiliary headings, so they can be consumed accordingly.

4) We should not make it obligatory to mark up subtitles. Except
   that an overlong heading creates other problems, it should
   remain 100% OK to concatenate heading and auxiliary headings
   into a heading without auxiliary headings.
   So both of the following fake code variants should be OK:
   [1] <heading>Frankenstein;</heading>
       <aux.Heading>or, the Modern Prometheus</aux.Heading>
   [2] <heading>Frankenstein; or, the Modern Prometheus</heading>
   (And while it shouldn’t be the default, such concatenation of
   heading and subtitle should be permitted in outlines as well.
   Such concatenation already happens in book library catalogs.)

5) Yet: If something is clearly a subtitle, it should be possible
   to tell authors that: 'Sorry, you have marked up an auxiliary
   heading/subtitle as a real header'. Or: 'sorry, but the way you
   did it, the auxiliary heading nature of that <p> does not get
   conveyed to the users. Or: 'The reason why that JavaScript 
   implementation of the HTML5 outline algorithm (such as the MS
   one, http://ie.microsoft.com/testdrive/HTML5/SemanticNotepad)
   does include that element, is because you have not marked it up
   as an *auxiliary* heading.

>
> If yes do you or anyone have concrete proposals on how
> to modify hgroup
>

Let me hear if you think following changes would bring us forward:

a) limit hgroup’s 'heading content' from (today) the entire
   element to first occurrence of the highest ranked h1-h6 child.
   NOTE: From now on, I name this child as 'heading content'.

b) define the rest of hgroup’s content as auxiliary heading(s).

   NOTE about a) and b): This is similar to <caption>, which is
   part of of the <table> element without itself being table.

c) allow <p> as auxiliary heading/subtitle

d) do not touch hgroup’s effect on outlines, except for one thing:
   if there is no h1-h6 children, the hgroup doesn't have any rank
   (currently it gets a rank even when there is no h1-h6 child).

e) present each auxiliary heading as a subtitle to ATs, but 
   (typically) without mentioning their rank. Also see point f).

f) If rank of 'heading content' is of same rank as the first,
   adjacent subtitle (e.g. if hgroup has two, parallel <h1>
   children), UA MAY suppress the adjacent subtitle’s auxiliary
   nature, so the element is presented as part of the heading
   content - visually, this can be achieved e.g. by adding
   style="display:run-in" on the 'heading content' element:
            <hgroup><h1 style="display:run-in" >Frankenstein;</h1>
                    <h1>or, the Modern Prometheus</h1></hgroup>
   Demo:http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2158

   NOTE:By default, still only first h1 would occur in outlines.

g) Add some 'baby steps' limitations, to avoid overcomplicated
   solutions until we get more implementation experience:

   1) Limit the 'heading content' element to be the first child of
      hgroup. This makes it simpelr to select/style via CSS and
      simpler to understand. All current examples of hgroup in the
      spec keep the primary element as the first one.

   2) Say that all auxiliary headings of a particular hgroup 
      SHOULD/MUST be of the same level (that is: of a single level):
            <hgroup><h1>Frankenstein;</h1>
                    <p>or, the Modern Prometheus</p>
                    <p>A Gothic novel</p></hgroup>
      Negative/Unrecommended example:
            <hgroup><h1>Frankenstein;</h1>
                    <h2>or, the Modern Prometheus</h2>
                    <p>A Gothic novel</p></hgroup>
      NOTE: a parallel subtitle of same rank as heading content,
           is in this regard not counted - thus, this is OK:
            <hgroup><h1 style="display:run-in">Frankenstein;</h1>
                    <h1>or, the Modern Prometheus</h1>
                    <p>A Gothic novel</p></hgroup>

i) Add advice about how to cater for legacy ATs and legacy UAs:
  1. Point out that use of <p> for subtitles has the advantage
     that it doesn’t have the legacy issues of being included in
     ToC's and outlines. To instead use h1-h6 elements may risk
     confusing users or legacy AT etc. Recommend to style the
     <p> to make it get the right size etc.
  2. Also, point out that <p> can be used as an auxiliary, lower
     ranked heading for <h6> (this use case is not possible
     to serve with today’s spec!)
  3. Recommend auxiliary heading(s) to be of lower rank than the
     next heading. This helps distinguishing the subtitle from the
     subsequent heading when CSS is disabled etc. Example: 
            <hgroup><h1>Frankenstein;</h1>
                    <p>or, the Modern Prometheus</p></hgroup>
                    <h1>Chapter 1</h1>
      Negative/Unrecommended example:
            <hgroup><h1>Frankenstein;</h1>
                    <h1>or, the Modern Prometheus</h1></hgroup>
                    <h1>Chapter 1</h1>
  4) Recommend authors to bind the heading content and auxiliary
     headings together verbally. The word 'or' in the Frankenstein
     heading might serve as an example of how it can be verbally
     signaled that the second h1 element really is a subtitle of
     the first h1 element:
            <hgroup><h1>Frankenstein;</h1>
                    <h1>or, the Modern Prometheus</h1></hgroup>
-- 
leif halvard silli

Received on Saturday, 9 March 2013 16:05:47 UTC