From 9bab1a95a5f87e79bd90df60772b214aad961f1f Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Sat, 4 Nov 2023 14:14:28 -0700 Subject: [PATCH] LibWeb: Keep track of AnimationEffect's previous phase and iteration This will be required for detecting transitions in StyleComputer --- Userland/Libraries/LibWeb/Animations/AnimationEffect.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Userland/Libraries/LibWeb/Animations/AnimationEffect.h b/Userland/Libraries/LibWeb/Animations/AnimationEffect.h index 4156d92bb2..a0d9138327 100644 --- a/Userland/Libraries/LibWeb/Animations/AnimationEffect.h +++ b/Userland/Libraries/LibWeb/Animations/AnimationEffect.h @@ -129,6 +129,11 @@ public: }; Phase phase() const; + Phase previous_phase() const { return m_previous_phase; } + void set_previous_phase(Phase value) { m_previous_phase = value; } + double previous_current_iteration() const { return m_previous_current_iteration; } + void set_previous_current_iteration(double value) { m_previous_current_iteration = value; } + Optional overall_progress() const; Optional directed_progress() const; AnimationDirection current_direction() const; @@ -173,6 +178,10 @@ protected: // https://www.w3.org/TR/web-animations-1/#time-transformations TimingFunction m_timing_function { linear_timing_function }; + + // Used for calculating transitions in StyleComputer + Phase m_previous_phase { Phase::Idle }; + double m_previous_current_iteration { 0.0 }; }; }