LibWeb/DOM: Fire transition[cancel,start,run,end] events

This commit is contained in:
Lucas CHOLLET 2024-12-22 18:26:52 -05:00 committed by Andreas Kling
commit 1c61ccef40
Notes: github-actions[bot] 2024-12-25 16:15:01 +00:00
6 changed files with 152 additions and 1 deletions

View file

@ -39,6 +39,17 @@ public:
double timing_function_output_at_time(double t) const;
NonnullRefPtr<CSSStyleValue const> value_at_time(double t) const;
// This is designed to be created from AnimationEffect::Phase.
enum class Phase : u8 {
Before,
Active,
After,
Idle,
Pending,
};
Phase previous_phase() const { return m_previous_phase; }
void set_previous_phase(Phase phase) { m_previous_phase = phase; }
private:
CSSTransition(JS::Realm&, DOM::Element&, PropertyID, size_t transition_generation,
double start_time, double end_time, NonnullRefPtr<CSSStyleValue const> start_value, NonnullRefPtr<CSSStyleValue const> end_value,
@ -75,6 +86,8 @@ private:
GC::Ref<Animations::KeyframeEffect> m_keyframe_effect;
GC::Ptr<CSS::CSSStyleDeclaration const> m_cached_declaration;
Phase m_previous_phase { Phase::Idle };
};
}