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

Re: [css3-animation] keyframes and percentages

From: Glenn Adams <glenn@skynav.com>
Date: Thu, 11 Oct 2012 09:54:43 +0800
Message-ID: <CACQ=j+f5pkq+C68WkqWkS1cDh_G66s+yxgBaf_0Zmw5P40Fs=w@mail.gmail.com>
To: Øyvind Stenhaug <oyvinds@opera.com>
Cc: www-style@w3.org
On Wed, Oct 10, 2012 at 8:21 PM, Øyvind Stenhaug <oyvinds@opera.com> wrote:

> On Wed, 10 Oct 2012 04:20:59 +0200, Glenn Adams <glenn@skynav.com> wrote:
>
>  keep in mind that
>>
>> -20%, 20% { top: 10px; animation-timing-function: ease-out; }
>>
>> should not ignore the 20% keyframe, but ignore the -20% keyframe
>>
>
> I dont' think this follows from the current editor's draft, or at the very
> least it's not at all clear.
> "The keyframe selector for a keyframe style rule consists of a
> comma-separated list of percentage values or the keywords ‘from’ or ‘to’"
>
> "If a keyframe selector specifies negative percentage values or values
> higher than 100%, then the keyframe will be ignored."
> I read that as saying that if the comma-separated list contains negative
> percentage values or values >100%, the entire rule (selector + block) is
> ignored. I suppose it's possible to read it differently.
>

I agree the spec language is ambiguous. My original reading was as yours,
i.e., that saying "the keyframe will be ignored" meant the entire "keyframe
style rule" (i.e., the "keyframe selector" and the following "keyframe
declaration block")

However, as I re-read that paragraph, I noticed that "keyframe" was used to
refer to specific values in the keyframe selector, e.g.

   - a ‘0%’ keyframe
   - a ‘100%’ or ‘to’ keyframe

which leads to interpreting "keyframe" as a specific value in the selector.
Eventually, I decided that the following text which appears at the end of
the paragraph containing the above uses

If a keyframe selector specifies negative percentage values or values
higher than 100%, then the keyframe will be ignored.

was referring to ignoring the bad keyframe values as opposed to ignoring
the entire keyframe style rule. That was also the interpretation of Simon
Fraser (Apple) [2].

I implemented this fix in WK at [1].

[1] https://bugs.webkit.org/attachment.cgi?id=166381&action=prettypatch
[2] https://bugs.webkit.org/show_bug.cgi?id=96844#c7


>
> For consistency with regular declaration blocks, I think it would probably
> make the most sense if percentage values outside the interval [0%, 100%]
> were treated as invalid and caused the entire thing to be dropped, similar
> to the way ":first-child, :foo { top: 10px; }" gets dropped. This is what
> the ED seems to imply to me, but as mentioned it's not very clear.
>
> The alternative you describe, which also seems to be the approach taken by
> Firefox, doesn't seem quite so consistent, but I suppose it's not too bad.
> It would basically be like "div, foo { top: 10px; }" where it's somehow
> known that a document can never contain any elements of type "foo".
>
>
>  also, note the CSS2.1 Errata s.4.3.1 [1]
>>
>
> Thanks, but this doesn't affect the syntax chapter. Looks like it should
> have, though, as pointed out in the replies to <
> http://lists.w3.org/Archives/**Public/www-style/2012May/0727.**html<http://lists.w3.org/Archives/Public/www-style/2012May/0727.html>
> >.
>
>
> --
> Øyvind Stenhaug
> Core Norway, Opera Software ASA
>
Received on Thursday, 11 October 2012 01:55:30 GMT

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