W3C home > Mailing lists > Public > www-style@w3.org > October 2012

Re: [css3-animation] keyframes and percentages

From: Øyvind Stenhaug <oyvinds@opera.com>
Date: Tue, 09 Oct 2012 16:36:34 +0200
To: "Yves Lafon" <ylafon@w3.org>
Cc: www-style@w3.org
Message-ID: <op.wlw1i8sfbunlto@oyvinds-desktop>
On Tue, 09 Oct 2012 15:03:37 +0200, Yves Lafon <ylafon@w3.org> wrote:

> On Tue, 9 Oct 2012, Øyvind Stenhaug wrote:
>
>> On Tue, 09 Oct 2012 13:28:35 +0200, Yves Lafon <ylafon@w3.org> wrote:

>>> -20% {
>>>   top: 10px;
>>>   animation-timing-function: ease-out;
>>> }
>>
>> Even with the working draft, this is not valid per the keyframes_blocks  
>> grammar.
>
> keyframe_selector: [ FROM_SYM | TO_SYM | PERCENTAGE ] S* [ ',' S* [  
> FROM_SYM | TO_SYM | PERCENTAGE ] S* ]*;
> and PERCENTAGE allows -20%

The spec probably needs to have a reference pointing to the definition of  
PERCENTAGE et al. I was looking at http://www.w3.org/TR/CSS21/syndata.html  
where

PERCENTAGE 	{num}%

num 	[0-9]+|[0-9]*\.[0-9]+

Not sure if there is a contradictory definition anywhere else.

> That said, the new prose is good enough to constraint what's valid or  
> not.

Actually, I don't find the formulation "is ignored" very clear.

There doesn't seem to be interoperability on this point. Based on some  
quick testing,
* Opera drops the keyframe completely if its selector doesn't match the  
grammar, but keeps it in the CSSOM otherwise (keyframe selectors like  
"300%" become empty strings, though)
* Firefox keeps keyframes with selectors like "-100%" and "200%", but not  
with selectors like "foo"
* Chrome drops the entire @keyframes rule (but things like "foo{}" or  
"body{background:red}" just become regular stand-alone declaration  
blocks(!))

-- 
Øyvind Stenhaug
Core Norway, Opera Software ASA
Received on Tuesday, 9 October 2012 14:37:04 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:01 GMT