Browse Source

LibWeb: Stop animation driver timer after document becomes inactive

Aliaksandr Kalenik 1 year ago
parent
commit
ecce570cb7
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Userland/Libraries/LibWeb/DOM/Document.cpp

+ 3 - 0
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())
         if (document_observer->document_became_inactive())
             document_observer->document_became_inactive()->function()();
             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<HTML::HTMLParser>)
 void Document::increment_throw_on_dynamic_markup_insertion_counter(Badge<HTML::HTMLParser>)