W3C home > Mailing lists > Public > public-html@w3.org > June 2009

Re: Outline algorithm and empty sections

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 10 Jun 2009 00:33:20 +0000 (UTC)
To: James Graham <jgraham@opera.com>
Cc: HTML WG <public-html@w3.org>
Message-ID: <Pine.LNX.4.62.0906100020120.1648@hixie.dreamhostps.com>
On Fri, 15 May 2009, James Graham wrote:
>
> I'm not sure if I already posted feedback on this somewhere I couldn't 
> find it but apologies if I did.
> 
> If the outline algorithm is applied to a document like:
> 
> <body>
> <section>
> <h1>Foo</h1>
> </section>
> </body>
> 
> It produces an empty heading for the <body> section and a subsection of 
> <body> named Foo.

It's more likely that the document would be something like:

   <body>
    <iframe></iframe>
    <section>
     <h1> ... </h1>
     ...
    </section>
    <p>...</p>
   </body>

...or some such. I don't know that this is really wrong, to be honest. I 
mean, it's suboptimal, but...


> Similarly, if the author does something like
> 
> <article>
>  <h1>This is my post</h1>
>  <section>
>   <p>This is the main text</p>
>  </section>
> </article>
> 
> then they will end up with the text in an untitled subsection of the 
> article, even though that is not what they intended.

This does seem like a more serious problem, yes.


> I think the above patterns are rather common with existing <div>-based 
> content and the outline algorithm will be more robust if we deal with 
> them gracefully. It seems like it is sufficient to ignore sections with 
> no explicit heading when computing the outline; this does not imply any 
> loss of expressiveness since one can always add an empty heading element 
> to explicitly express an intention to have a blank heading for a 
> section.

I expect certain sections -- <aside>s and <nav>s especially -- to often 
not have explicit headings, but we shouldn't shove all of their contents 
into the section the <aside> or <nav> themselves are in.

We could make <section> and <article> require headings and then ignore 
<section> and <article> elements with no heading element, I guess? I don't 
really want to encourage people to have empty headings, though.

How about a more specific heuristic for the case of an <article> 
containing just one heading-less <section> and no other paragraphs?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 10 June 2009 00:33:53 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:04 UTC