Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animations with no duration set aren't executed as per spec #568

Open
gribelu opened this issue Mar 6, 2014 · 3 comments
Open

Animations with no duration set aren't executed as per spec #568

gribelu opened this issue Mar 6, 2014 · 3 comments

Comments

@gribelu
Copy link

gribelu commented Mar 6, 2014

Hello,

The spec says that when an animation has no duration set, the properties are set on the target element with no interpolation: http://dev.w3.org/fxtf/web-animations/#creating-a-new-animation-object
The polyfill only does this when explicitly setting duration to 0.

Also, should this be the same when using an EffectCallback? The spec isn't clear on this. When setting duration to 0 the callback isn't executed at all.

Thanks!

@alancutter
Copy link
Contributor

I wonder if this is related to the default fill mode for animation being none. Do you have an example that shows the issue and describe what you expected to happen?

@gribelu
Copy link
Author

gribelu commented Apr 6, 2014

Indeed, explicitly setting the fill mode to 'forwards' will apply the properties. But why is the default fill 'none'? The part of the spec I was referring to says:

It is also possible to omit the timing parameter altogether in which case default timing values will be used. Since the intrinsic iteration duration of an animation is zero, and the default fill when constructing an Animation is forwards, it is possible to create animations that simply set a property without any interpolation as follows,

new Animation(elem, { display: 'none' });

I also tested this using an EffectCallback and the effect is the same. If setting fill mode to forwards the callback is executed just once.

I played with it in here if you want to see an example: http://jsfiddle.net/cwunF/

@ewilligers
Copy link
Contributor

the default fill when constructing an Animation is forwards

That part of the spec has been changed. Now the default for an animation is no fill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants