LibWeb/Animations: Don't assume that animations have an effect

I agree that the spec definition of this function isn't super clear
about that, but from "Web Animations 1 - 4.5. Animations"[1]:

An animation is a timing node that binds an animation effect child,
called its associated effect, to a timeline parent so that it runs. Both
of these associations are optional and configurable such that an
animation can have no associated effect or timeline at a given moment.

[1]: https://drafts.csswg.org/web-animations-1/#animations
This commit is contained in:
Lucas CHOLLET 2024-12-22 21:23:13 -05:00 committed by Andreas Kling
commit c39ef2a738
Notes: github-actions[bot] 2024-12-25 16:15:16 +00:00

View file

@ -314,7 +314,7 @@ bool Animation::is_relevant() const
// An animation is relevant if:
// - Its associated effect is current or in effect, and
// - Its replace state is not removed.
return (m_effect->is_current() || m_effect->is_in_effect()) && replace_state() != Bindings::AnimationReplaceState::Removed;
return (m_effect && (m_effect->is_current() || m_effect->is_in_effect())) && replace_state() != Bindings::AnimationReplaceState::Removed;
}
// https://www.w3.org/TR/web-animations-1/#replaceable-animation