1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

LibWeb: Add a few Animation/AnimationEffect getters

This commit is contained in:
Matthew Olsson 2024-02-03 18:54:49 -07:00 committed by Andreas Kling
parent 06a8674eec
commit 145ae54718
5 changed files with 55 additions and 1 deletions

View file

@ -298,6 +298,15 @@ Bindings::AnimationPlayState Animation::play_state() const
return Bindings::AnimationPlayState::Running;
}
// https://www.w3.org/TR/web-animations-1/#animation-relevant
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;
}
// https://www.w3.org/TR/web-animations-1/#replaceable-animation
bool Animation::is_replaceable() const
{