1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:57:44 +00:00

LibWeb: Keep track of associated Animations in AnimationTimeline

This allows the timeline to propagate changes in time to any relevant
animation objects.
This commit is contained in:
Matthew Olsson 2023-11-04 11:58:09 -07:00 committed by Andreas Kling
parent 0d3c8a1cd9
commit 4efbb10a36
2 changed files with 12 additions and 0 deletions

View file

@ -28,6 +28,10 @@ public:
virtual Optional<double> convert_a_timeline_time_to_an_original_relative_time(Optional<double>) { VERIFY_NOT_REACHED(); }
virtual bool can_convert_a_timeline_time_to_an_original_relative_time() const { return false; }
void associate_with_animation(JS::NonnullGCPtr<Animation> value) { m_associated_animations.set(value); }
void disassociate_with_animation(JS::NonnullGCPtr<Animation> value) { m_associated_animations.remove(value); }
HashTable<JS::NonnullGCPtr<Animation>> const& associated_animations() const;
protected:
AnimationTimeline(JS::Realm&);
virtual ~AnimationTimeline() override;
@ -43,6 +47,8 @@ protected:
// https://www.w3.org/TR/web-animations-1/#timeline-associated-with-a-document
JS::GCPtr<DOM::Document> m_associated_document {};
HashTable<JS::NonnullGCPtr<Animation>> m_associated_animations {};
};
}