W3C home > Mailing lists > Public > www-style@w3.org > September 2006

RE: [CSS21] Possible counters() limitation?

From: Paul Nelson (ATC) <paulnel@winse.microsoft.com>
Date: Sun, 10 Sep 2006 17:54:47 -0700
Message-ID: <49C257E2C13F584790B2E302E021B6F9110FD543@winse-msg-01.segroup.winse.corp.microsoft.com>
To: Simon Pieters <zcorpan@hotmail.com>, <dbaron@dbaron.org>, <www-style@w3.org>

> The heading/section outline algorighm[1] in HTML5 is a lot more
complicated than what can be 
> expressed with CSS counters

Is there truly a need to make things "a lot more complicated"? Are there
real user scenarios that justify this complexity?

Paul
 

-----Original Message-----
From: www-style-request@w3.org [mailto:www-style-request@w3.org] On
Behalf Of Simon Pieters
Sent: Sunday, September 10, 2006 1:19 AM
To: dbaron@dbaron.org; www-style@w3.org
Subject: Re: [CSS21] Possible counters() limitation?


Hi,

From: "L. David Baron" <dbaron@dbaron.org>
>On Saturday 2006-09-09 16:51 +0000, Simon Pieters wrote:
> > You're right. Here's a second shot:
> >
> >    :root, h ~ section:first-of-type { counter-reset:headers; }
> >    h::before { content:counters(headers, ".");
>counter-increment:headers; }
>
>That won't work if some sections are nested within divs, e.g.:
>
><section>
>   <h>should be 1</h>
>   <div>
>     <section>
>       <h>should be 1.1</h>
>     </section>
>   </div>
>   <section>
>     <h>should be 1.2</h>
>   </section>
></section>

Yeah, and that's just the tip of the iceberg. For instance, if CSS
counters should be able to create a correct outline of any HTML5
document then something else is needed. The heading/section outline
algorighm[1] in HTML5 is a lot more complicated than what can be
expressed with CSS counters (since there are multiple sectioning
elements, multiple heading elements, implied sections, and some heading
elements are not part of the outline).

[1] http://whatwg.org/specs/web-apps/current-work/#headings

Regards,
Simon Pieters
Received on Monday, 11 September 2006 00:54:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:46 GMT