Re: Parent Combinator / Parent pseudo-class

Francois Remy wrote:
> 
> From: "Andrew Fedoniouk" <news@terrainformatica.com>
>>
>> Francois Remy wrote:
>>>
>>> Yes, there's another solution : you can watch change applied on the 
>>> elements that can change the value of the rule.
>>> But it's not possible to know when an element changes in JScript...
>>
>> Imagine that I you have some event that is fired when one of its
>> attributes, states or its subtree is getting changed.
>> (Lets put aside for the second when such an event needs to be fired)
>>
>> How it will help you?
> 
> You don't need to run the whole selector each time there's a DOM 
> modification, only each one that are applying on elements that are 
> concerned by the rule.

First:

Let's say for the selector:

html:with-child(a:hover) p
{
   border: 1px solid green;
}

what would be the mechanism that does "only each one
that are applying on elements that are concerned by the rule"?

Second:

Consider these two selectors:

p
   {
     border: none;
   }

html:with-child(a:hover) p
   {
     border: 2em;
   }

and markup:

<html>
   <p><a href="*">sample</a></p>
</html>

In such case selector above will never be true
if to assume that computation of selectors happens instantly.

On real world PCs with finite time needed for computation you
will see nice oscillation.


-- 
Andrew Fedoniouk.

http://terrainformatica.com

Received on Friday, 25 July 2008 05:02:06 UTC