From 1735f3d9aa1d272b6d7d43467bd35da7e5ad03fd Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Fri, 2 Feb 2024 16:29:11 -0700 Subject: [PATCH] LibWeb: Add keyframe state to KeyframeEffect This was taken from StyleComputer, and will eventually be removed from StyleComputer once we transition to using Web animations. --- .../Libraries/LibWeb/Animations/KeyframeEffect.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Animations/KeyframeEffect.h b/Userland/Libraries/LibWeb/Animations/KeyframeEffect.h index e39ad72ba4..191eb4c798 100644 --- a/Userland/Libraries/LibWeb/Animations/KeyframeEffect.h +++ b/Userland/Libraries/LibWeb/Animations/KeyframeEffect.h @@ -7,12 +7,12 @@ #pragma once #include +#include #include #include #include #include #include -#include namespace Web::Animations { @@ -58,6 +58,14 @@ class KeyframeEffect : public AnimationEffect { JS_DECLARE_ALLOCATOR(KeyframeEffect); public: + struct KeyFrameSet : public RefCounted { + struct UseInitial { }; + struct ResolvedKeyFrame { + HashMap>> resolved_properties {}; + }; + RedBlackTree keyframes_by_key; + }; + static JS::NonnullGCPtr create(JS::Realm&); static WebIDL::ExceptionOr> construct_impl( @@ -80,6 +88,9 @@ public: WebIDL::ExceptionOr> get_keyframes(); WebIDL::ExceptionOr set_keyframes(Optional> const&); + KeyFrameSet const* key_frame_set() { return m_key_frame_set; } + void set_key_frame_set(RefPtr key_frame_set) { m_key_frame_set = key_frame_set; } + private: KeyframeEffect(JS::Realm&); @@ -100,6 +111,8 @@ private: // A cached version of m_keyframes suitable for returning from get_keyframes() Vector m_keyframe_objects {}; + + RefPtr m_key_frame_set {}; }; }