[css-conditional] !important in @support (was: [css-fonts] grammar changes for @font-face and @font-feature-values rules)

Le 30/04/2013 07:44, John Daggett a écrit :
> I've updated the CSS3 Fonts draft based on Simon's feedback.
>
>> AFAICT, the point of <descriptor_declaration> is to not have the <prio>
>> production for !important. You could, like @supports, refer to
>> <declaration> defined in the Core Grammar instead.
> Does @supports specifically ban the <prio> production?  I don't see
> the language in there for that.  It's a relatively minor point but I
> added the production to be clear that '!important' has no function in
> @font-face rules (there have been issues brought up in the past in
> relation to this).

I just assumed that because @supports defines <declaration> explicitly 
by referring to Chapter 4:

   declaration : property S* ':' S* value;

rather than Appendix G:

declaration
   : property ':' S* expr prio?
   ;


But I was wrong. !important is allowed and has no effect. This is 
specified in section 6, just before section 6.1:

> A trailing ‘!important’ on a declaration being tested is allowed,
> though it won't change the validity of the declaration.
>
> For example, the following rule is valid:
>
> @supports (display: flexbox !important) {
>   // ...
> }

-- 
Simon Sapin

Received on Tuesday, 30 April 2013 07:47:16 UTC