- From: Paul Nelson (ATC) <paulnel@winse.microsoft.com>
- Date: Sun, 10 Sep 2006 17:54:47 -0700
- 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 UTC