[whatwg] Re: <section> and headings

James Graham jg307 at cam.ac.uk
Wed Nov 17 02:09:31 PST 2004



Ian Hickson wrote:

>On Thu, 2 Sep 2004, James Graham wrote:
>  
>
>
>  
>
>>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.
>
Why are those two inequivalent under my definition? Both would produce 
the same tree structure. Both mark the <h3> as less important then the 
<h2> which is less important than the <h1>. As far as I can tell, the 
differences come when one looks at fragments like: 

  <section>
  <h1>..</h1>
    <section>
    <h1>..</h1>
      <section>
      <h1>..</h1>

Unless I have missed something, in the current webapps spec, this is (in 
HTML5) exactly equivalent to the two examples that you gave, and indeed 
authors are encouraged to use this form. Clearly this is not equivalent 
to the HTML4ised version:
  <h1>..</h1>
  <h1>..</h1>
  <h1>..</h1>
My proposal would make this example semantically different to your 
examples in both HTML4 and HTML5, and would retain the letter of the 
HTML4 spec (and, indeed, the sense in which many people have interpreted 
it). It therefore makes authors more likely to use markup that will 
behave as expected in HTML4 UAs.




More information about the whatwg mailing list