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

An implementor's thoughts on selectors

From: Douglas Rand <drand@sgi.com>
Date: Fri, 12 Dec 1997 09:29:04 -0500
Message-ID: <34914A30.A4324BEC@sgi.com>
To: www-style@w3.org
I want to start by saying that I'm in favor of extending selectors
to allow sibling and parent specification.  I still rather hate the
syntax and I would like some other syntax to be adopted.  

Here are some thoughts from an implementation point of view.  One of
the things I've done in our CSS implementation is implement an efficient
caching scheme so the same style objects are shared and not recreated. 
The caching is done on a combination of tags and attributes (attributes
are used wherever they modify the style sheet) kept in a stack.  

The parent restrictions are thus not a real issue,  the tag stack
remains a valid caching key,  but the sibling relationships are more
difficult,  especially in light of DHTML where one might add content to
the end of a containing block later.  

What I'd particularly caution against, in hopes of efficient
implementation,  are complex sibling relationships.  Those are going to
be very hard to capture in a way which can be quickly checked for as a
browser processes the document structure.  So I'm in favor of things
like :first and :last but not :following[B] since that last is quite
difficult to capture.

It is,  of course,  possibly to work around this sort of thing so that
there is no performance penalty for cases where sibling relationships
are not specified.  Nonetheless,  it is an important consideration.

Doug
-- 
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, 12 December 1997 09:28:58 GMT

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