W3C home > Mailing lists > Public > www-style@w3.org > February 2003

Re: comments on Selectors

From: Peter S. Linss <peter@linss.com>
Date: Mon, 17 Feb 2003 17:33:22 -0800
Message-ID: <3E518D62.1050007@linss.com>
To: Brant Langer Gurganus <brantgurganus2001@cherokeescouting.org>
CC: Boris Zbarsky <bzbarsky@MIT.EDU>, W3C Style List <www-style@w3.org>

Brant Langer Gurganus wrote:

> Boris Zbarsky wrote:
>>>      From my understanding, explicitly including the *
>>>      under current implementations takes longer for matching to the
>>>      correct element
>> Which implementations is that the case for, out of curiousity?
>> Boris
> I think I found where I saw that before 
> (http://www.mozilla.org/xpfe/goodcss.html).  It looks like it includes 
> implied style rules as well.  Probably a misunderstanding on my part.  
> Its been a while since I read it and who knows how up-to-date the 
> document is.
This is a misunderstanding on your part wrt Mozilla. I haven't looked at 
the code in a long time but I am the original implementor of the Mozilla 
style matching code. The document you refer to matches my recollection 
of the original implementation so it doesn't seem to have changed in any 
way that effects this discussion.

The warning about performance hits for the universal selector refers 
only to rules that have no other specificity in the "key selector" (to 
use the document's terminology).

* { color: red; }
is slower than
h1 { color: red; }

*.foo { color: red; }

is just as fast as:
.foo { color: red; }

In fact, the implementation does not differentiate between the two (or 
at least it didn't once upon a time).
Received on Monday, 17 February 2003 21:31:15 UTC

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