Re: Temporary removal of animations

On Tue, Nov 18, 2014 at 11:11 AM, Jonathan Moore <moore@eds.org> wrote:
> I don't think this is a browser bug. I think it is a unforchent consequence
> of  web animations being an async API. With all other style/layout APIs the
> effects of actions are immediate. Attached is an example of the kind of
> thing I do in my lib. What I would like is some way to see the effects of
> the cancel() immediately; or better yet a way to ask for the computed style
> ignoring the animations effects ( without interrupting the animation ).

Thanks for the example!  Yes, that confirms that it's a timing issue;
the effects of stopping the animation haven't yet been recalculated
when you first ask for the data.  Adding a new element forces a style
recalc, as the browser needs to figure out what styles apply to that
element.

There are other ways to force style recalcs; this sort of issue is
unfortunately common on the web, and you should be able to find plenty
of tutorials for it.

~TJ

Received on Tuesday, 18 November 2014 19:33:44 UTC