W3C home > Mailing lists > Public > www-style@w3.org > July 2008

Re: Parent Combinator / Parent pseudo-class

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 23 Jul 2008 09:54:50 -0700
Message-ID: <4887625A.2010407@mit.edu>
To: Brad Kemper <brkemper@comcast.net>
CC: www-style list <www-style@w3.org>

Brad Kemper wrote:
> Can you post a test case, using JavaScript to simulate this, to show how 
> slow?

Probably, but honestly this is a very low priority for me.  So I doubt 
I'll get to it any time soon (months).

> Where one element with a child is thus selected?

In general, any time you have such a selector any DOM mutation means 
walking the entire DOM tree and adjusting all the styles.  Or having 
some sort of rather mechanism that tells you what parts of the DOM you 
need to walk.

This can be optimized in various ways if you know something particular 
about how you're using the selectors, of course.  So you can get away 
with a bit less if you're doing it in JS for a particular page, but NOT 
if you're trying to write a general-purpose thing like a toolkit.

Received on Wednesday, 23 July 2008 16:55:35 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:38 UTC