W3C home > Mailing lists > Public > www-style@w3.org > October 2000

Re: New version of the Selectors module of CSS3

From: Jonas Sicking <sicking@bigfoot.com>
Date: Fri, 6 Oct 2000 03:56:51 +0200
Message-ID: <01a401c02f38$b244c7e0$3110f7d4@ericsson.se>
To: <www-style@w3.org>
Ian Hickson wrote:
> On Fri, 6 Oct 2000, Jonas Sicking wrote:
>
> > 5. entities
> > If I have a XML file containing unresolved entities it could be really
> > useful to be able to style those. If I for example have an XML file
system
> > users I could do.
> >
> > Email > &null; { color: red; content: 'missing'; font-weight: bold}
>
> This sounds like one of those things that are Evil. Should there be any
> difference between &something; and 'the string to which something
> expands'? How are entities represented in the DOM?

I think that resolved entities can be compleatly replaced with a textnode in
the DOM, but unresolved onces should be represented by an EntityReference
node.

> > 3. nth-last-child(n)
> > 4. nth-child(3 to 10)
> > 6. every other child (this one is new : )
>
> Yes! I completely agree.
>
> I proposed a comprehensive way of doing all of these. I have included the
> text of my proposal below.
>
>
> STRUCTURAL PSEUDO-CLASSES
>
> I propose the following list of pseudo-classes. They are largely based on
> the :nth-child and related pseudos in the current draft, but have been
> made more useful, more generic, and more consistent with each other.
>
>    :child(n,m) - matches an element that has n+xm-1 siblings before it
>    in the document tree, for all x. (n>=1, m=0 or m>=n, x>=0). In
>    other words, this matches the nth child of an element after all the
>    children have been split into groups of m elements each. For
>    example, this allows the selectors to address every other row in a
>    table, and could be used, for example, to alternate the colour of
>    paragraph text in a cycle of four.
>
>      TR:child(1,2) /* address every odd row */
>      TR:child(2,2) /* address every even row */
>

[bigtime snip]

>
>    :child(even) - directly equivalent to :child(1,2).
>
>    :child(odd) - directly equivalent to :child(2,2).
>
>    :child-of-type(n) - directly equivalent to :child-of-type(n,0).
>
>    :child-of-type(even) - directly equivalent to :child-of-type(1,2).
>
>    :child-of-type(odd) - directly equivalent to :child-of-type(2,2).
>
>
> BTW, the reason I renamed :nth-child to :child is that :nth-child is
> an ugly name according to David. While I agree, the naming is a
> secondary issue IMHO, it is the functionality I am interested in.

Seems we agree on functionallity, just differ on the syntax, which really
isn't that important...
Really like that (odd) and (even) syntax though, but as
:nth-child-of-type(even) : )

/ Jonas Sicking
Received on Thursday, 5 October 2000 21:55:52 GMT

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