W3C home > Mailing lists > Public > www-style@w3.org > December 2011

Re: [css3-animations] dynamic changes to animation properties or keyframes

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 1 Dec 2011 08:31:42 -0800
Message-ID: <CAAWBYDCXURgsgObuiBigrwjYh_yee+XZ2uPqofN=kUANAg6wvw@mail.gmail.com>
To: Øyvind Stenhaug <oyvinds@opera.com>
Cc: www-style@w3.org, "L. David Baron" <dbaron@dbaron.org>
On Thu, Dec 1, 2011 at 5:04 AM, Øyvind Stenhaug <oyvinds@opera.com> wrote:
> On Sun, 06 Nov 2011 20:48:53 +0100, L. David Baron <dbaron@dbaron.org>
> wrote:
>
>> On Saturday 2011-04-02 12:14 -0700, L. David Baron wrote:
>>>
>>> http://dev.w3.org/csswg/css3-animations/#animations says:
>>>  # The values used for the keyframes and animation properties are
>>>  # snapshotted at the time the animation starts. Changing them
>>>  # during the execution of the animation has no effect. Note also,
>>>  # that changing the value of ‘animation-name’ does not necessarily
>>>  # restart an animation (e.g. if a list of animations are applied
>>>  # and one is removed from the list, only that animation will stop;
>>>  # The other animations will continue). In order to restart an
>>>  # animation, it must be removed then reapplied.
>>>
>>> This doesn't appear to match WebKit's behavior.  For example, in the
>>
>> [...]
>>>
>>> Should the spec say instead that dynamic changes are honored, but
>>> the animation start time (as adjusted by pause duration) is
>>> preserved for each animation name?
>>
>> I'd note that if the spec does take this approach, it needs to
>> describe what happens when an animation-name occurs more than once
>> in the list of animations:
>
> I think the spec needs to describe that regardless.
>
> I can think of two main approaches. Using
>
> @keyframes name { foo }
> #test { animation: name 1s, name 2s }
>
> as an example:
>
> a) Behave similarly to
>
> @keyframes name1 { foo }
> @keyframes name2 { foo }
> #test { animation: name1 1s, name2 2s }
>
> b) Behave similarly to
>
> @keyframes name { foo }
> #test { animation: name-that-matches-no-at-rule 1s, name 2s }
>
> Where option a) seems kind of nice (can effectively have multiple animations
> re-using the same @keyframes rule).

(a) is effectively equivalent to (b), since a later animation
manipulating the same property as an earlier animation wins.  The only
difference is when you're measuring the start or end of transitions
via the JS events.

~TJ
Received on Thursday, 1 December 2011 16:32:38 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:47 GMT