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

Re: Styling by attribute-based association?

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 25 Oct 2005 21:47:54 +0000 (UTC)
To: Boris Zbarsky <bzbarsky@MIT.EDU>
Cc: W3C CSS <www-style@w3.org>
Message-ID: <Pine.LNX.4.62.0510252144510.6813@dhalsim.dreamhost.com>

On Tue, 25 Oct 2005, Boris Zbarsky wrote:

> Ian Hickson wrote:
> >    label:friend(for, [type=date]) { ... }
> > 
> > ...would select all labels pointing at elements with type="date".
> > 
> > This selector wouldn't be expensive to process, particularly (it wouldn't be
> > cheap, but it doesn't have the potential to run away scanning the entire DOM
> > tree or anything, assuming IDs are cached).
>
> This selector is not expensive to match on if you're already resolving 
> style for the element.  It's expensive in the face of dynamic updates, 
> though. Whenever a node is removed from the DOM or the ID of a node 
> changes, you have to walk the whole DOM looking for labels that pointed 
> to the old id and changing their style.

Yeah, good point. (And the same the other way around, looking for labels 
that now apply to it and didn't before.)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 25 October 2005 21:48:01 GMT

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