1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:47:45 +00:00

LibWeb: Transition StyleComputer to Web Animations

With this commit, we are finally running animations off of the web
animations spec! A lot of the work StyleComputer is doing is now done
elsewhere. For example, fill-forward animations are handled by
Animation::is_relevant() returning true in the after phase, meaning the
"active_state_if_fill_forward" map is no longer needed.
This commit is contained in:
Matthew Olsson 2024-02-22 13:56:15 +00:00 committed by Andreas Kling
parent b258ba2767
commit ae3326a447
7 changed files with 270 additions and 647 deletions

View file

@ -561,6 +561,7 @@ public:
void append_pending_animation_event(PendingAnimationEvent const&);
void update_animations_and_send_events(Optional<double> const& timestamp);
void remove_replaced_animations();
void ensure_animation_timer();
bool ready_to_run_scripts() const { return m_ready_to_run_scripts; }
@ -620,6 +621,8 @@ private:
Element* find_a_potential_indicated_element(FlyString const& fragment) const;
void dispatch_events_for_animation_if_necessary(JS::NonnullGCPtr<Animations::Animation>);
JS::NonnullGCPtr<Page> m_page;
OwnPtr<CSS::StyleComputer> m_style_computer;
JS::GCPtr<CSS::StyleSheetList> m_style_sheets;
@ -815,6 +818,7 @@ private:
// https://www.w3.org/TR/web-animations-1/#pending-animation-event-queue
Vector<PendingAnimationEvent> m_pending_animation_event_queue;
RefPtr<Platform::Timer> m_animation_driver_timer;
bool m_needs_to_call_page_did_load { false };