mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-12-03 19:44:22 +00:00
CSSAnimation: Detach ended animation from element before running completions
This commit is contained in:
1 parent
b63a118eeb
commit
5fdf3ec834
1 file changed
+17
-8
@@ -218,14 +218,15 @@ CSSAnimation.prototype.endEventListener = function()
|
||||
if (inFlightAnimationsNames.length > 0)
|
||||
return;
|
||||
|
||||
for (var i = 0; i < animationsNames.length; i++)
|
||||
{
|
||||
var completion = animation.completionFunctionForAnimationName(animationsNames[i]);
|
||||
|
||||
if (completion)
|
||||
completion();
|
||||
}
|
||||
|
||||
/*
|
||||
2026-11-26: The completions ran before the animation was removed from the
|
||||
element. A completion that started a new animation of the same element, through
|
||||
the layout that the completion handler of its grouping requests, found the
|
||||
element still in use: the new animation was ignored, never ended, and its own
|
||||
grouping never completed. The cleanup could also remove the new animation's
|
||||
properties. The animation is now removed first, then the completions run. Both
|
||||
happen in one task, so the element is not drawn between them.
|
||||
*/
|
||||
var eventTarget = event.target,
|
||||
style = eventTarget.style;
|
||||
|
||||
@@ -250,6 +251,14 @@ CSSAnimation.prototype.endEventListener = function()
|
||||
{
|
||||
console.warn("CSSAnimation.j - " + err);
|
||||
}
|
||||
|
||||
for (var i = 0; i < animationsNames.length; i++)
|
||||
{
|
||||
var completion = animation.completionFunctionForAnimationName(animationsNames[i]);
|
||||
|
||||
if (completion)
|
||||
completion();
|
||||
}
|
||||
};
|
||||
|
||||
this.listener = AnimationEndListener;
|
||||
|
||||
Reference in new issue
Block a user