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

Re: Computational complexity of CSS

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Wed, 16 Nov 2005 09:38:19 -0800
Message-ID: <008801c5ead4$892a6330$3201a8c0@Terra>
To: "Bjoern Hoehrmann" <derhoermi@gmx.net>
Cc: <www-style@w3.org>


----- Original Message ----- 
From: "Bjoern Hoehrmann" <derhoermi@gmx.net>
To: "Andrew Fedoniouk" <news@terrainformatica.com>
Cc: <www-style@w3.org>
Sent: Wednesday, November 16, 2005 9:14 AM
Subject: Re: Computational complexity of CSS


>* Andrew Fedoniouk wrote:
>>For example system of styles written as :
>>
>>select
>>{
>>   option
>>   {
>>      background-color: color1
>>   }
>>   @:focus option
>>   {
>>      background-color: color2
>>   }
>>}
>>
>>effectively reduces lookup complexity as inner style blocks
>>need to be scanned only for children of the <select> - not
>>for all N nodes in the document.
> 
> I don't really understand how this is different from your
> 
>  select > option { background-color: color1... }
>  select:focus > option { background-color: color2 ... }
> 
> Why is it not possible for an implementation to behave as if it rewrites
> this syntax to your improved syntax and benefit from the more efficient
> implementation?
> -- 

Did it already. Does not work.

Think about specificity of style selectors. CSS *requires* them to be 
placed in flat table.

Andrew Fedoniouk.
http://terrainformatica.com
Received on Wednesday, 16 November 2005 17:39:01 GMT

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