LibWeb: Store Animations in Animatable instead of AnimationEffects

This is closer to what the spec instructs us to do, and matches how
associations are maintained in the timelines. Also note that the removed
destructor logic is not necessary since we visit the associated
animations anyways.
This commit is contained in:
Matthew Olsson 2024-03-07 11:11:27 -07:00 committed by Alexander Kalenik
commit 90290eb985
Notes: sideshowbarker 2024-07-17 00:16:31 +09:00
5 changed files with 22 additions and 26 deletions

View file

@ -30,8 +30,8 @@ public:
WebIDL::ExceptionOr<JS::NonnullGCPtr<Animation>> animate(Optional<JS::Handle<JS::Object>> keyframes, Variant<Empty, double, KeyframeAnimationOptions> options = {});
Vector<JS::NonnullGCPtr<Animation>> get_animations(GetAnimationsOptions options = {});
void associate_with_effect(JS::NonnullGCPtr<AnimationEffect> effect);
void disassociate_with_effect(JS::NonnullGCPtr<AnimationEffect> effect);
void associate_with_animation(JS::NonnullGCPtr<Animation>);
void disassociate_with_animation(JS::NonnullGCPtr<Animation>);
JS::GCPtr<CSS::CSSStyleDeclaration const> cached_animation_name_source() const { return m_cached_animation_name_source; }
void set_cached_animation_name_source(JS::GCPtr<CSS::CSSStyleDeclaration const> value) { m_cached_animation_name_source = value; }
@ -43,7 +43,7 @@ protected:
void visit_edges(JS::Cell::Visitor&);
private:
Vector<JS::NonnullGCPtr<AnimationEffect>> m_associated_effects;
Vector<JS::NonnullGCPtr<Animation>> m_associated_animations;
bool m_is_sorted_by_composite_order { true };
JS::GCPtr<CSS::CSSStyleDeclaration const> m_cached_animation_name_source;
JS::GCPtr<Animations::Animation> m_cached_animation_name_animation;