Re: Errors in CSS1, CSS2 specs (mainly css grammar)

On Mon, 11 Jan 1999, Bert Bos wrote:
>> Here is an extract from the CSS1 grammar: [snip]
>> According to this, a number *is* allowed at the start of a class, [snip]
>> #    * in CSS1, selectors (element names, classes and IDs) can contain
>> #      only the characters A-Z, 0-9, and Unicode characters 161-255, plus
>> #      dash (-); they cannot start with a dash or a digit; [...]
>>                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Indeed. This error in the grammar seems to haunt us, and this time
> again we forgot to correct it :-( The intention is that class names
> may not start with a digit, so the error is in the grammar. [snip]
>> The last paragraph of the CSS2 grammar says:
>> #   In CSS1, a class name could start with a digit (".55ft"), [snip]
> In fact, the whole paragraph might have been omitted. CSS1 only
> *appeared* to allow initial digits, but as you pointed out, the text
> in 7.1 explicitly forbade them.

Heh. As you say, this error does seem to reappear on a worryingly
regular basis...

I reported the error as being an error in the CSS1 paragraph quoted
above, instead of in the CSS1 grammar, because that way the error only
spanned one spec. Correcting the CSS1 grammar results in the error
being propagated to CSS2.

>> CSS1, Appendix B, Paragraph 2 [1]: 
>> #   It is in some sense, however, still a superset of CSS1: there are
>> #   additional semantic constraints not expressed in this grammar.
>> The word "superset" should be "subset".
> No, it should not. The grammar defines a language that is smaller
> than the language defined in 7.1, but still larger than CSS1. For
> example, appendix B allows 'font-size: bold', which is not a legal
> declaration in CSS1.

Hmm. I was looking at it from the point of view of 'the grammar listed
below is smaller than the grammar that would accurately portray CSS1'
(hence it is a subset of CSS1) rather than 'what the grammar listed
below *allows* is larger than what is allowed in CSS1' (hence it being
a superset of CSS1). It's a good thing the paragraph is qualified with
the phrase "in some sense"...

>> The CSS2 grammar [2] appears to be missing the line returning CLASS
>> altogether.
> Correct, but this is not an error. CSS2 doesn't define "class" as a
> terminal symbol, but instead as a non-terminal:
>     class: '.' IDENT;
> It is at a different level in the definition, but the effect is the
> same (and this time the initial digit *is* forbidden :-) )
I stand corrected.

-- 
Ian Hickson

Received on Monday, 11 January 1999 08:31:50 UTC