[whatwg] Yet another <section> <h> and <hn> idea.

With respect to <section>, <h>, and <hn>, I would suggest the following:

For any <hn>, if n is less than or equal to the number of sections it is 
nested inside, it is semantically equivelant to <h>;

<section>
   <h1>1st level header</h1>
   <p>content</p>
</section>

<section>
   <h>1st level header</h>
   <p>content</p>
   <section>
     <h2>2nd level header</h2>
     <p>content</p>
   </section>
   <section>
     <h1>_Also_ 2nd level header</h1>
     <p>content</p>
   </section>
</section>

Around any hn with n greater than the number of sections, there are 
implied semantic sections. These implied sections end at the end of the 
containing explicit section (or other containing block) or at the start 
of the next hn with an equal or lower value of n;

<section>
   <h1>1st level header</h1>
   <p>content</p>
   <!-- section -->
     <h2>2nd level header</h2>
     <p>content</p>
   <!-- /section -->
</section>

<section>
   <h1>1st level header</h1>
   <p>content</p>
   <!-- section -->
     <!-- section -->
       <h3>3rd level header</h3>
       <p>content</p>
     <!-- /section -->
   <!-- /section -->
</section>


For a legacy document:

<!-- section -->
   <h1>1st level header</h1>
   <p>content</p>
   <!-- section -->
     <h2>2nd level header</h2>
     <p>content</p>
     <!-- section -->
       <h3>3rd level header</h3>
       <p>content</p>
     <!-- end section -->
   <!-- end section -->
<!-- /section -->


A more complex example, with h and hn chosen off the top of my head:

<section>
   <h>1st level header</h>
   <p>content</p>
   <!-- section -->
     <!-- section -->
       <h3>3rd level header</h3>
       <p>content</p>
     <!-- /section -->
     <h2>2nd level header</h2>
     <p>content</p>
   <!-- /section -->
   <section>
     <h1>2nd level header</h1>
     <p>content</p>
   <!-- /section -->
   <!-- section -->     <!-- This implied split I'm not sure about, but
                             it seems to be best [1] [2] -->
     <h2>2nd level header</h2>
     <p>content</p>
     <section>
       <h>3rd level header</h>
       <p>content</p>
       <section>
         <!-- section -->
           <!-- section -->
             <h6>6th level header</h6>
             <p>content</p>
           <!-- /section -->
         <!-- /section -->
       <!-- /section --> <!-- Another implied split -->
       <!-- section -->
         <h>4th level header</h>
         <p>content</p>
       </section>
     </section>
   </section>
</section>

[1] This also answers the question of what happens if you have two 
headers in a section. The possibilities are assume the second one is a 
subsection, assume they're both subsections, or assume they're both 
normal sections, with an implied split. I think the implied split is best...

[2] ...Or it could just be declared invalid, and there could be a limit 
of one header per section. Can you have content before the header, 
though? How about subsections before the header? And what about implied 
subsections? Hmm... have to think about it, but it might work. (Too lazy 
to revise my big long example, though)

Received on Wednesday, 24 November 2004 21:29:15 UTC