From c39ef2a738392025cf09416095ba1f46a83018c6 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Sun, 22 Dec 2024 21:23:13 -0500 Subject: [PATCH] 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 --- Libraries/LibWeb/Animations/Animation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibWeb/Animations/Animation.cpp b/Libraries/LibWeb/Animations/Animation.cpp index 9f2a3d5b657..332be06960c 100644 --- a/Libraries/LibWeb/Animations/Animation.cpp +++ b/Libraries/LibWeb/Animations/Animation.cpp @@ -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