Re: [css3-animation] keyframes and percentages

On Oct 10, 2012, at 5:21 am, Řyvind Stenhaug <> wrote:

> On Wed, 10 Oct 2012 04:20:59 +0200, Glenn Adams <> 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.

You're right in that what people want isn't covered by the draft, and I'm not sure how it should be worded to fix that.

One option would be to describe an algorithm that separates out keyframes with comma-separated keyframe selectors into individual keyframes with simple selectors before applying the "ignore negative values" rule.

> 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.

This was already discussed, and it was decided that keeping the non-negative keyframes was preferable.

> 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 <>.


Received on Wednesday, 10 October 2012 17:15:27 UTC