W3C home > Mailing lists > Public > www-style@w3.org > December 1997

Re: Selector Readabiliitiy [sic]

From: Douglas Rand <drand@sgi.com>
Date: Fri, 05 Dec 1997 10:57:54 -0500
Message-ID: <34882482.A63655FD@sgi.com>
To: Andrew n marshall <amarshal@usc.edu>
CC: "'Douglas Rand'" <drand@sgi.com>, "'www-style@w3.org'" <www-style@w3.org>
Andrew n marshall wrote:
> On Thursday, December 04, 1997 1:53 PM, Douglas Rand
> [SMTP:drand@pobox.engr.sgi.com] wrote:
> > >DIV.Chapter P:first-child
> >
> > > Would mean the first paragraph of a chapter as denoted by a DIV block.
> >
> > I can't see this as being a good thing.  You need to at least specify
> > what the P is a child of.  Maybe P:first-child(DIV.Chapter).  You need
> > to do this because there isn't a direct relationship between any pair
> > of tags in the selector,  and I think introducing one based on a
> pseudoclass
> > is a mistake.  Kind of a mixed metaphor.
> Ops .  I forgot to specify 'immediate'.  The correct version of in syntax
> would be:
> DIV.Chapter ~P:first-child
> However, I do not see a need to explicitly specify the parent.  The concept
> of 'child' implies it is of it's parent, whatever that may be in the
> document tree.  And 'first' is implicitly relative to the other child or
> that parent, therefore the element's siblings.

No,  it doesn't.  If I have a tree where DIV.Chapter has a number
of children,  e.g. a table,  I might want to write selectors like

DIV.Chapter P:child[TD] { ... }
DIV.Chapter P:child[DIV.Chapter] { ... }
DIV.Chapter P:first-child[DIV.Chapter] { ... }

That is one of the reasons that the / stuff is awkward to me.  I
think it is extremely reasonable to have arbitrary qualifiers.  
An example:

P:child[TD]:grandchild[TR.special] { ... }

Of course the whole thing can get out of hand.  But you get the
idea of the sorts of things that might be nice to do.  I suspect
that child and sibling relationships,  along with some sort of
child count constraint (at least first and last and not first or last)
would be sufficient.


Doug Rand				drand@sgi.com
Silicon Graphics/SSO			http://reality.sgi.com/drand
Disclaimer: These are my views,  SGI's views are in 3D
Received on Friday, 5 December 1997 11:08:45 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:45 UTC