An implementor's thoughts on selectors

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 UTC