- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Tue, 25 Oct 2005 16:34:21 -0500
- To: Ian Hickson <ian@hixie.ch>
- CC: W3C CSS <www-style@w3.org>
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. That is, this selector is good at defeating attempts to not recompute style for the entire DOM on DOM mutations. -Boris
Received on Tuesday, 25 October 2005 21:34:53 UTC