[CSS21] Errata for at-rules in declaration lists

Hi Bert,

Please find below an additional CSS 2.1 errata entry for the changes 
described in [1] and resolved by the WG in [2].

[1] http://lists.w3.org/Archives/Public/www-style/2013Apr/0506.html
[2] http://lists.w3.org/Archives/Public/www-style/2013May/0783.html


In §4.1.1 Tokenization, in the grammar, the ruleset is changed to:

     ruleset: selector? '{' S* declaration-list '}' S*;

And a declaration-list production is added:

     declaration-list
         : declaration [ ';' S* declaration-list ]?
         | at-rule declaration-list
         | /* empty */
         ;

(Note: this is using recursion rather than repetition to avoid unbounded 
look-ahead.)


In §4.1.7 Rule sets, declaration blocks, and selectors:

> In between there must be a list of zero or more semicolon-separated
> (;) declarations.

Replace the above with:

> In between there must be a list of zero or more declarations and
> at-rules. Declarations must end with a semicolon (;) unless they’re
> last in the list.
>
> Note: CSS level 2 has no at-rules that may appear inside rule sets,
> but such at-rules may be defined in future levels.

(The first part is a bit awkward. Feel free to rephrase.)


In §4.2 Rules for handling parsing errors, in the "Malformed 
declarations" list item, add:

> When the UA expects the start of a declaration or at-rule (i.e., an
> IDENT token or an ATKEYWORD token) but finds an unexpected token
> instead, that token is considered to be the first token of a
> malformed declaration. I.e., the rule for malformed declarations,
> rather than malformed statements is used to determine which tokens to
> ignore in that case.

… and remove the paragraph that had that same text in §13.2 Page boxes: 
the @page rule. (ie. @page is not a special case anymore.)

Change the first example "p { color:green }" to be
"p { @foo { bar: baz } color:green }"


-- 
Simon Sapin

Received on Monday, 11 November 2013 10:29:28 UTC