Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 106edd02a3cc67449bfd4024396c45d124aeb7ab
      
https://github.com/WebKit/WebKit/commit/106edd02a3cc67449bfd4024396c45d124aeb7ab
  Author: Antoine Quint <[email protected]>
  Date:   2026-04-08 (Wed, 08 Apr 2026)

  Changed paths:
    A 
LayoutTests/webanimations/custom-effect/custom-effect-set-to-null-in-callback-expected.txt
    A 
LayoutTests/webanimations/custom-effect/custom-effect-set-to-null-in-callback.html
    M Source/WebCore/animation/AnimationEffect.h
    M Source/WebCore/animation/KeyframeEffect.h
    M Source/WebCore/animation/WebAnimation.cpp

  Log Message:
  -----------
  [web-animations] setting effect to null in `CustomEffect` callback leads to a 
crash
https://bugs.webkit.org/show_bug.cgi?id=311072
rdar://173671661

Reviewed by Anne van Kesteren.

The callback for a `CustomEffect`, which is called under 
`CustomEffect::animationDidTick()`,
can reset the associated animation's effect to null. We must make sure that the 
subsequent
call to `AnimationEffect::animationBecameReady()` is performed on a valid 
effect.

Since the only concrete implementation of 
`AnimationEffect::animationBecameReady()` was for
`KeyframeEffect`, we move this function to `KeyframeEffect` instead of being a 
virtual function
on the superclass.

Test: webanimations/custom-effect/custom-effect-set-to-null-in-callback.html

* 
LayoutTests/webanimations/custom-effect/custom-effect-set-to-null-in-callback-expected.txt:
 Added.
* 
LayoutTests/webanimations/custom-effect/custom-effect-set-to-null-in-callback.html:
 Added.
* Source/WebCore/animation/AnimationEffect.h:
(WebCore::AnimationEffect::animationDidTick):
(WebCore::AnimationEffect::animationBecameReady): Deleted.
* Source/WebCore/animation/KeyframeEffect.h:
* Source/WebCore/animation/WebAnimation.cpp:
(WebCore::WebAnimation::tick):

Canonical link: https://commits.webkit.org/310785@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to