Re: Computational complexity of CSS

On Wed, Nov 16, 2005 at 12:53:19PM -0800, Andrew Fedoniouk wrote:
> I beleive that at least some recommendations should be
> published on W3C site like:
> ".a1 > .a2" is better than ".a1 .a2"
> "p[a1]" is better than just "[a1]",
> etc.

I think I'm right in saying that at least the second of those will
actually be _slower_ in Gecko: it resolves style from the 'inside out',
so upon adding an attribute 'a1', it will actually have to do additional
work to check that the attribute belongs to an element called 'p'

Even if that's not entirely accurate, it's still true to say that those
kind of suggestions would have to be made in the context of a specific
implementation, because, as several people have mentioned, the assertions
you've made above don't actually follow from the specification at all.  So
I could see Mozilla or Opera publishing 'Optimising CSS for {Gecko,Opera}'
documents, perhaps, but it's not really something that falls to W3C to do.


Received on Wednesday, 16 November 2005 23:58:30 UTC