Re: [XHTML2] How are UAs to interpret <h> and <hx> elements?

Laurens Holst wrote:
> 
> Lachlan Hunt wrote:
>> 4. Define the top level heading to be body>h, if present, or 
>> body>section>h otherwise.
> 
> That would at least be difficult to express in CSS, which is an 
> important technology with which XHTML 2 has to be used, and which can 
> not be adapted to express this either.

For the general case, it wouldn't be too difficult.

body>section>h, body>h { /* level 1 */ }
body>section>section>h, body>h~section>h { /* level 2 */ }
body>section>section>section>h, body>h~section>section>h {/* level 3 */}

Though, that does have a problem when the top level heading follows a 
section like this:

<body>
   <!-- These two are rendered as level 1 and level 2, respectively,
        because they precede body>h -->
   <section>
     <h>Level 2</h>
     <section>
       <h>Level 3</h>
     </section>
   </section>

   <!-- The following are all rendered as intended -->
   <h>Level 1</h>
   <section>
     <h>Level 2</h>
     <section>
       <h>Level 3</h>
     </section>
   </section>
</body>

-- 
Lachlan Hunt
http://lachy.id.au/

Received on Monday, 13 June 2005 02:27:06 UTC