CPAnimationContext fix: Run the grouping completion handler before the run loop pass

This commit is contained in:
David Richardson committed 2026-11-26 09:28:46 -06:00
1 parent 25612c228d
commit d2f1112b6b
1 file changed
+13 -4
+13 -4
View File
@@ -159,11 +159,20 @@ var _CPAnimationContextStack = nil,
if (animationCompletion)
animationCompletion();
if (needsPeriodicFrameUpdates || animationCompletion)
[[CPRunLoop currentRunLoop] performSelectors];
/*
2026-11-26: The completion handler of the grouping ran after the run loop pass.
This function runs from a browser animation end event, outside the run loop, so
the layout and display that the handler requested waited for the next event. After
a table column drag, the delegate's column move appeared up to seconds later, when
the pointer moved. The handler now runs first, and the run loop pass follows.
*/
var agent = _completionHandlerAgent;
if (_completionHandlerAgent)
_completionHandlerAgent.decrement();
if (agent)
agent.decrement();
if (needsPeriodicFrameUpdates || animationCompletion || agent)
[[CPRunLoop currentRunLoop] performSelectors];
};
if (![animation isKindOfClass:[CAPropertyAnimation class]] || !(animatedKeyPath = [animation keyPath]))