diff --git a/AppKit/CoreAnimation/CPAnimationContext.j b/AppKit/CoreAnimation/CPAnimationContext.j index 4ef5eae98..4c54b9806 100644 --- a/AppKit/CoreAnimation/CPAnimationContext.j +++ b/AppKit/CoreAnimation/CPAnimationContext.j @@ -142,12 +142,7 @@ var _CPAnimationContextStack = nil, duration = [animation duration] || [self duration]; needsPeriodicFrameUpdates = [[anObject animator] needsPeriodicFrameUpdatesForKeyPath:aKeyPath]; - - var animatorClass = [[anObject class] animatorClass], - needsPeriodicFrameUpdates = ((aKeyPath === @"frame" || aKeyPath === @"frameSize" || [[anObject animator] wantsPeriodicFrameUpdates]) && (objectId = [anObject UID])); - - if (_completionHandlerAgent) - _completionHandlerAgent.increment(); + var animatorClass = [[anObject class] animatorClass]; var completionFunction = function() { @@ -273,16 +268,7 @@ var _CPAnimationContextStack = nil, - (void)getAnimations:(CPArray)cssAnimations getTimers:(CPArray)timers usingAction:(Object)anAction cssAnimate:(BOOL)needsCSSAnimation { - var targetView = anAction.object, - values = anAction.values, - keyPath = anAction.keypath, - isFrameKeyPath = (keyPath == @"frame" || keyPath == @"frameSize"), - customLayout = [targetView hasCustomLayoutSubviews], - customDrawing = [targetView hasCustomDrawRect], - declarative_subviews_layout = (!customLayout || [targetView implementsSelector:@selector(frameRectOfView:inSuperviewSize:)]), - needsPeriodicFrameUpdates = [[targetView animator] needsPeriodicFrameUpdatesForKeyPath:keyPath], - timer = nil, - animatorClass = [[targetView class] animatorClass]; + var values = anAction.values; if (values.length == 2) { @@ -295,6 +281,16 @@ var _CPAnimationContextStack = nil, return; } + var targetView = anAction.object, + keyPath = anAction.keypath, + isFrameKeyPath = (keyPath == @"frame" || keyPath == @"frameSize"), + customLayout = [targetView hasCustomLayoutSubviews], + customDrawing = [targetView hasCustomDrawRect], + declarative_subviews_layout = (!customLayout || [targetView implementsSelector:@selector(frameRectOfView:inSuperviewSize:)]), + needsPeriodicFrameUpdates = [[targetView animator] needsPeriodicFrameUpdatesForKeyPath:keyPath], + timer = nil, + animatorClass = [[targetView class] animatorClass]; + if (needsCSSAnimation) { [animatorClass addAnimations:cssAnimations forAction:anAction];