From ecce570cb7a0d6132f8c03f969b83e76c1cff3cf Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Mon, 11 Mar 2024 04:02:29 +0100 Subject: [PATCH] LibWeb: Stop animation driver timer after document becomes inactive --- Userland/Libraries/LibWeb/DOM/Document.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 7840445726..93629248d3 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -3127,6 +3127,9 @@ void Document::did_stop_being_active_document_in_navigable() if (document_observer->document_became_inactive()) document_observer->document_became_inactive()->function()(); } + + if (m_animation_driver_timer) + m_animation_driver_timer->stop(); } void Document::increment_throw_on_dynamic_markup_insertion_counter(Badge)