W3C home > Mailing lists > Public > www-style@w3.org > April 2013

[css-syntax] At-rules mixed in any declaration list?

From: Simon Sapin <simon.sapin@exyr.org>
Date: Sat, 20 Apr 2013 23:05:21 +0200
Message-ID: <51730311.9070206@exyr.org>
To: "www-style@w3.org" <www-style@w3.org>
Hi,

Should any list of declarations also accept at-rules, like the body of 
@page rules? This potentially affects style rules, style attribute, and 
various at-rules. Even if no at-rules are recognized yet, it makes a 
difference in where a new declaration starts:

Parsed as unknown at-rule followed by a valid declaration:

   @page {
     @margin-note { /* not supported */ }
     background: green;
   }

In CSS 2.1, parsed as a single invalid declaration. The at-keyword 
instead of the expected ident (property name) is an error; the parser 
recovers at the next semi-colon:

   body {
     @nested h1 { /* not supported */ }
     background: red;
   }


I think we should make that change for all lists of declarations and get 
the error recovery in place, and not wait until we actually need it (eg. 
when/if we want nested rules inside style rules.) CSS 2.1 did the same 
for @page: no nested at-rule was defined yet, but the syntax still 
allowed them.

-- 
Simon Sapin
Received on Saturday, 20 April 2013 21:05:46 UTC

This archive was generated by hypermail 2.3.1 : Saturday, 20 April 2013 21:05:46 UTC