[whatwg] Re: <section> and headings

Ian Hickson ian at hixie.ch
Tue Nov 16 06:29:14 PST 2004


On Thu, 2 Sep 2004, James Graham wrote:
> On 2 Sep 2004, at 03:32, Lachlan Hunt wrote:
> > 
> > So, what outline would this produce?
> > <body>
> >     <h1>Heading 1</h1>
> >     <h2>Heading 2</h2>
> >     <h4>Heading 4</h4>
> > </body>
> > 
> > IMO, the two are semantically equivalent, and should produce identical 
> > outlines.
> 
> None of those headings are children of <section> elements so the most 
> backward compatible approach would be to treat them as HTML4 headings.

Indeed, we're not going to start making huge changes to the semantics of 
millions of existing documents.


> The "A level $level heading is missing" approach is terrible UI (for a 
> client application rather than for the validator) because the user 
> doesn't care that the markup is imperfect and has no way to fix the 
> problem anyway. So even with pure HTML4 I would expect any client app to 
> produce an outline like:
> 
> Heading 1
> |--Heading 2
>    |--Heading 4
> 
> As I've mentioned, I don't really think the HTML 4 heading model is 
> robust enough to create structure. Hence my desire to tweak it.

Indeed.

This is also why I feel that <section> should define headings such that 
there is no way to end up with a "missing level". Not by making such 
constructs non-conforming, but by simply defining them so that it isn't a 
problem and the headings are automatically nested appropriately.


> My model ignores whether one uses <h1>, <h2>... or even a hypothetical 
> <h> for the purposes of structure (justification: authors already do the 
> same so we're unlikely to break any UAs that work with real websites). 
> The choice of <h1>....<h6> should reflect the 'importance' of the 
> heading. In a highly structured document, this might reflect the 
> structure. In a newspaper, this might reflect the editorial importance 
> attached to each story. In a document with a sidebar, the sidebar 
> headings might be given lower importance than the headings in the main 
> content.

I do like this idea, but it isn't really workable. We need authors to be 
able to use HTML5 markup and yet still have it render correctly in HTML4 
UAs, which basically means that we need <h2>-<h6> to mean exactly what 
they do in HTML4, or at least mean that as much as anything else. So we 
couldn't say that <h3> meant a minor heading, since otherwise the 
following:

   <h1>...</h1>
   <section>
    <h2>...</h2>
    <section>
     <h3>...</h3>

...would not be exactly equivalent to:

   <h1>...</h1>
   <h2>...</h2>
   <h3>...</h3>

...which we want.   


> Yeah, that worried me too. I was also concerned about the speed impact 
> of the additional CSS rules that would be required in the UA stylesheet. 
> However authors already use heading elements as subtitles. So having a 
> standardised mechanism to do this would be nice.

<header> is that mechanism in WA1 at the moment.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list