Re: Computational complexity of CSS

* Andrew Fedoniouk wrote:
>4-digits number you've mentioned defines order in which style definition
>must be scanned.  This number defines exact position of style definition
>in style lookup table.  To resolve style of each element in the dom
>you shall check *each* entry in the table. This 4-number does not
>allow you to implement semantic grouping of styles. 4-number
>requirement means exactly flat table lookup list organization.

Yes, the point is, there is no such requirement. Given a style sheet and
a document, CSS just defines what the specified property value for each
property and element is, implementations may use any algorithm they like
to find them. The problem isn't always "does this selector match this
element or not?" you might as well ask which elements are matched by the
selector, or which rules specify the 'color' property and which of these
rules is the winning declaration. You may also choose not to determine
specified values for things you don't render, or use special structures
to hold your data.

>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.

That's on the other hand a good suggestion; I'm not sure it's important
to have this on the W3C web site, but see http://www.w3.org/QA/Tips/ for
how to submit such a document to W3C.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Wednesday, 16 November 2005 22:35:51 UTC