W3C home > Mailing lists > Public > www-style@w3.org > January 2006

Re: Selectors: section 6.5: Error

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Tue, 03 Jan 2006 20:32:27 -0600
Message-ID: <43BB33BB.60000@mit.edu>
To: David Woolley <david@djwhome.demon.co.uk>
CC: www-style@w3.org

David Woolley wrote:
> Whilst I would prefer a world in which specifications could use 
> "don't care" rules, my vote, amongst the two options here, would be to
> only honour the first one

What's "first"?  Keep in mind that for CSS matching one usually has an element 
and then wants all the rules that apply to it, typically.  So you're saying that 
whether an id selector applies should require examining all elements preceding 
this one in a depth-first preorder traversal of the DOM?

Sounds slow to me.  :(  Especially on dynamic changes.

> as honouring all occurences makes ID selectors 
> indistinguishable from class selectors, except for the namespace

And except that in valid documents they will have different meaning in a 
stylesheet.... (semantically speaking).

> Honouring just the first ought to be easy to enforce

I see no decent way to enforce it that's performant.

> even if the matching mechanism naturally finds all matches

One usually matches rules to an element, not elements to a rule.

> as the ID can be modified in the DOM, so as not to match for this purpose.

Not sure what this means.  The CSS matching algorithm had better not modify the DOM.

-Boris
Received on Wednesday, 4 January 2006 02:32:31 GMT

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