Re: rulesets without selector

On Sat, 2 Dec 2000, Bjoern Hoehrmann wrote:
>
> Hi,
> 
> CSS Level 2 defines:
> 
>   ruleset : selector? '{'
>               S* declaration? [ ';' S* declaration? ]*
>             '}' S*;
> 
> Why is a selector optional? A stylesheet like
> 
>     { color: red }
> 
> does not make any sense to me.
> 
> selector is by the way defined as any+ where any can be a whitespace, so even
> if a selector is required, the above stylesheet conforms to the core syntax.

It is an error. The editor of the CSS3 Selectors spec (Daniel Glazman) is
aware of it and it should be fixed in CSS3.

One could argue this should be made an errata item in CSS2... Or maybe the
grammar should be made non-normative?

The textual description is correct.

-- 
Ian Hickson                                     )\     _. - ._.)       fL
Netscape, Standards Compliance QA              /. `- '  (  `--'
+1 650 937 6593                                `- , ) -  > ) \
irc.mozilla.org:Hixie _________________________  (.' \) (.' -' __________

Received on Saturday, 2 December 2000 15:02:38 UTC