[whatwg] Interaction of explicit and implicit sections (was: Re: Question on (new) header and hgroup)

On Thu, 07 May 2009 17:34:21 +0200, James Graham <jgraham at opera.com> wrote:

> Bruce Lawson wrote:
>> I'm struggling to understand the reasons for <hgroup>: wouldn't one or
>> more h1..h6 elements wrapped in the same <header> imply just such a
>> grouping without the need for such an element?
>>  To illustrate my query, what is the difference between
>>  <header>
>> <h1>HTML 5</h1>
>> <h2>a new era of loveliness</h2>
>> <nav> ... </nav>
>> </header>
>>  and
>>  <header>
>> <hgroup>
>> <h1>HTML 5</h1>
>> <h2>a new era of loveliness</h2>
>> </hgroup>
>> <nav> ... </nav>
>> </header>
>
> <hgroup> affects the document structure, <header> does not. So if you  
> made an outline view of your document, the examples above would look  
> (with the addition of a <hx> element inside the nav with content  
> "Navigation") like
>
> +--HTML 5
>     +--A new era of loveliness
>        +--Navigation

Actually I believe it would be:

+--HTML 5
    +--A new era of loveliness
    +--Navigation


This surprised me when I used implicit sections and just wrapped <article>s around news items (which were <h3>s). I expected the outline to be like it was without the <article>:

+--Site heading
   +--Page heading
      +--News item

...but instead it became (according to your and gsnedders' outliners):

+--Site heading
   +--Page heading
   +--News item


Maybe the spec should change here to match people's expectations better?


> +--HTML 5 - a new era of loveliness
>     +--Navigation
>
> So, in the first example "A new era of loveliness" is a real section  
> heading and the navigation becomes a subsection of that section. In the  
> second example the <hgroup> element tells us that the <h1> and <h2>  
> elements form a heading-subheading pair and that the navigation is a  
> subsection of the section headed by this heading/subheading pair.
>
> Is that any clearer?

-- 
Simon Pieters
Opera Software

Received on Thursday, 7 May 2009 15:58:21 UTC