W3C home > Mailing lists > Public > www-style@w3.org > May 1998

Re: Errors in section 12 (generated content)

From: Bert Bos <Bert.Bos@sophia.inria.fr>
Date: Mon, 11 May 1998 18:59:57 +0200 (MET DST)
To: Ian Hickson <exxieh@bath.ac.uk>
Cc: www-style@w3.org
Message-ID: <13655.9478.431914.190257@mygale.inria.fr>
Ian Hickson writes:
 > Here is a list of errors and typos in section 12
 > (http://www.w3.org/TR/PR-CSS2/generate.html) of the proposed recommendation.
 > Oh, and at the bottom is an idea for CSS3.
 > 
 > ***********************************************
 > 
 > >From section 12.1:
 > >P.note:before { content: "Note: ";
 > >                border: solid green}
 > >
 > >would cause a solid green border to be rendered
 > >around the entire paragraph, including the initial string.
 > 
 > I disagree. To get the effect described one would use
 > 
 > P.note:before { content: "Note: "; }
 > P.note        { border: solid green; }

Corrected.

 > 
 > ***********************************************
 > 
 > Row 4 of the table above 12.4.2
 > There is a "<" in the source which should be 'escaped' as &lt;

Corrected.

 > 
 > ***********************************************
 > 
 > The comment above 12.5.1 illustrates a major drawback of the counter
 > scheme - what if you do not control all of the stylesheets? Is there a way
 > around this? (I can't think of one offhand)
 > 
 > The comment in question is:
 > > The 'counter-reset' property follows the cascading
 > > rules. Thus, due to cascading, the following stylesheet:
 > >
 > > H1 {counter-reset: section -1}
 > > H1 {counter-reset: imagenum 99}
 > >
 > > will only reset 'imagenum'. To reset both counters,
 > > they have to be specified together:
 > >
 > > H1 {counter-reset: section -1 imagenum 99}

That's right, and I don't know a way around it either.

 > 
 > ***********************************************
 > 
 > The second example in section 12.4 has the rather exotic style sheet:
 > > LI:before
 > 
 > >               display: marker;
 > >               content: "(" numeric(counter) ")";
 > >               width: 6em;
 > >               text-align: center;
 > >           }
 > ...which should actually be:
 >  LI:before
 > 
 >                display: marker;
 >                content: "(" counter(counter) ")";
 >                           /*^^^^^^^*/
 >                counter-increment: counter;
 >              /*^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
 >                width: 6em;
 >                text-align: center;
 >            }

Corrected.

 > 
 > ***********************************************
 > 
 > The fourth example also uses the mysterious "numeric()" function (which
 > should be changed to counter()).

Corrected.

 > 
 > ***********************************************
 > 
 > Will CSS3 offer a way of refering to another elements counter?

I hope so. This is on my list under the general notion of
cross-references. They may refer to counters, but also to page numbers
("see equation 6 on page 23" or "see equation 6 on this page")

But as you note, this is probably not just a CSS issue: it needs some
markup.

 > 
 > I need to mention an image's caption. This is how I would mark it up (I've
 > used an imaginary XML language since I can't see of any way of doing this in
 > HTML4):
 > 
 > <IMG SRC="apicture.png" ID=thepic/>
 > <PARA>
 > Here we discuss the points raised in <REF REFID=thepic/>. There is nothing
 > special to mention.
 > </PARA>
 > 
 > Using the following style sheet:
 > 
 > PARA { display: block; }
 > 
 > IMG { float: left; background: attr(SRC);
 >       counter-increment: figures;
 >       padding: 10px; }
 > IMG[SRC=apicture.png] { width: 200px; height: 200px; }
 > IMG:before { content: "Fig " counter(figures); }
 > 
 > REF:before { content: "figure " proxycounter(attr(REFID), figures); }
 > 
 > /* proxycounter is the only addition here, all the rest is valid with
 > CSS2-PR */
 > 
 > Would hopefully make something looking like:
 > 
 > +--------+ Here we
 > |*Fig 1 *| discuss
 > |***    *| the points
 > |****  **| raised in
 > |********| figure 1.
 > +--------+ There is
 >  nothing special to
 >  mention.
 > 
 > ***********************************************


Thanks,

Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Monday, 11 May 1998 13:13:35 GMT

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