[css3-syntax] Style rules as a syntactic construct vs. selector + declarations that apply to elements

Hi,

Proposed changes
----------------

* Maybe rename "style rule" to something that only reflect the syntax 
and not the semantics. Ideas for the name? Tab had "qualified 
declaration block".
* Rename "selector" (in Syntax only) to "X prelude", where X is the 
result of the above. This parallels nicely with "at-rule prelude".
* Remove the definition of X being a Selector + declarations that apply 
to elements.
* For top-level style rules, have that definitions in css3-cascade. 
(css3-animation and css3-conditional already define how to interpret 
nested stuff with the style rule syntax.)


Execution
---------

If we want this, I can make the edits in a branch and make a pull 
request for review. (Yes, you read that last part right. More on that 
soon ^_^)


Rationale
---------

So in css3-syntax, a stylesheet is basically tree of style rules, 
at-rules and declarations. The module says very little on how to 
interpret them, expect for this part of §2:

> A style rule starts with a selector (defined by the Selectors
> specification[1]), then has a {}-wrapped block containing a sequence of
> declarations. The selector specifies which elements the declarations
> will apply to.
> [1] http://www.w3.org/TR/selectors/


But this is not always the case. For example, @keyframes rules contain 
stuff that use the style rule syntax but have "keyframe selectors" 
rather than Selectors selectors. On the other hand, @page rules also 
have "page selectors" but are not style rules.

An addition, some languages such as Disruptive Innovations’s STTS [2] or 
Tab Atkins’s CAS [3] use the CSS syntax but are not CSS. These will have 
their own semantics for stuff that use the style rule syntax. Our 
charter explicitly mentions such usage of the CSS syntax.

[2] STTS: http://disruptive-innovations.com/products/#STTS
[3] Cascading Attribute Sheets: http://www.xanthir.com/b4K_0

-- 
Simon Sapin

Received on Thursday, 7 February 2013 07:22:43 UTC