1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:27:35 +00:00

LibWeb: Keep track of associated AnimationEffects in Animatable

This commit is contained in:
Matthew Olsson 2024-02-03 12:10:44 -07:00 committed by Andreas Kling
parent 2ade834655
commit 5eea53f27a
4 changed files with 33 additions and 1 deletions

View file

@ -61,4 +61,14 @@ Vector<JS::NonnullGCPtr<Animation>> Animatable::get_animations(Web::Animations::
return {};
}
void Animatable::associate_with_effect(JS::NonnullGCPtr<AnimationEffect> effect)
{
m_associated_effects.append(effect);
}
void Animatable::disassociate_with_effect(JS::NonnullGCPtr<AnimationEffect> effect)
{
m_associated_effects.remove_first_matching([&](auto element) { return effect == element; });
}
}