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

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

From: François REMY <francois.remy.dev@outlook.com>
Date: Sat, 20 Apr 2013 22:03:12 +0000
Message-ID: <DUB403-EAS64BFDB14120777093E50A9A5C90@phx.gbl>
To: CSS WG <www-style@w3.org>, Simon Sapin <simon.sapin@exyr.org>
I support this idea.






De : Simon Sapin
Envoyé : ‎samedi‎ ‎20‎ ‎avril‎ ‎2013 ‎23‎:‎06
À : 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 22:04:06 UTC

This archive was generated by hypermail 2.3.1 : Saturday, 20 April 2013 22:04:07 UTC