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

LibWeb: Track an Animation's play/pause task state

This only tracks whether the relevant steps should be executed at some
future (but very soon) time. This time will eventually be whenever the
"update animations and send events" procedure is invoked.
This commit is contained in:
Matthew Olsson 2023-11-04 12:05:49 -07:00 committed by Andreas Kling
parent 422f43f4fc
commit 9802995de8
2 changed files with 26 additions and 5 deletions

View file

@ -55,6 +55,12 @@ protected:
virtual void visit_edges(Cell::Visitor&) override;
private:
enum class TaskState {
None,
Pending,
RunAsSoonAsReady,
};
void apply_any_pending_playback_rate();
JS::NonnullGCPtr<WebIDL::Promise> current_ready_promise() const;
@ -90,6 +96,12 @@ private:
// https://www.w3.org/TR/web-animations-1/#current-finished-promise
mutable JS::GCPtr<WebIDL::Promise> m_current_finished_promise;
// https://www.w3.org/TR/web-animations-1/#pending-play-task
TaskState m_pending_play_task { TaskState::None };
// https://www.w3.org/TR/web-animations-1/#pending-pause-task
TaskState m_pending_pause_task { TaskState::None };
};
}