CSS core syntax: Why is selector optional?

In the core syntax [1] (so this holds true for both CSS21 and CSS3), the
selector part of a ruleset is optional:

ruleset : selector? '{' S* declaration? [ ';' S* declaration? ]* '}' S*;

However, none of the different specific grammars for selectors (i.e.
neither the one for  CSS21 [2] nor for CSS3 [3]) actually allow a
selector to be empty.

My question is whether the selector being optional is a deliberate
decision to sometime allow rulesets like like

{ color: red; }
{ width: 20cm; }

(with reasonable semantics to be defined) or the core grammar should
better be changed to 

ruleset : selector '{' S* declaration? [ ';' S* declaration? ]* '}' S*;

, i.e. require a selector. This would then be much more in line with the
textual description in CSS21, 4.1.7 [4]:

"A rule set (also called "rule") consists of a selector followed by a
declaration block."

  and

"A selector always goes together with a {}-block."

What is the WG's rationale behind making it optional?

[1] <http://www.w3.org/TR/CSS21/syndata.html#tokenization>
[2] <http://www.w3.org/TR/CSS21/grammar.html>
[3] <http://www.w3.org/TR/2003/WD-css3-syntax-20030813/#grammar0>
[4] <http://www.w3.org/TR/CSS21/syndata.html#q10>


Regards, Christian.

Received on Tuesday, 8 February 2005 16:37:27 UTC