Re: Parent Combinator / Parent pseudo-class

On Jul 23, 2008, at 9:57 AM, Boris Zbarsky wrote:

> Brad Kemper wrote:
>> That's the same situation as with adjacent sibling combinators,  
>> isn't it? If you mutate the previous sibling, then you have to do  
>> style reresolution on a separate branch of the DOM tree.
>
> Yep.  In fact, in Gecko if you mutate a node there are adjacent  
> sibling selectors floating about we reresolve style on that node,  
> all its descendants, and all descendants of all following siblings.
>
> And it's slow, if you ever try it...  But faster than reresolving  
> everything in the document.

In fact, I do have an example of that, and it does not seem slow at  
all (except for some late-occurrence image loading in the second  
example):

http://bradclicks.com/cssplay/tabs.html

It works well in FireFox 3, but WebKit seems to not even bother with  
reresolving the style on the nodes.


P.S. The second example could have been done better if "inner shadow"  
was available, but that is a separate discussion.

Received on Wednesday, 23 July 2008 17:13:12 UTC