mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-21 20:24:42 +00:00
When a timer is cleared, e.g. clearInterval, we flag the task are deleted and maintain the entry in window._timers. When run, the task is ignored and deleted from _timers. This can result in prematurely rejecting timers due to `TooManyTimeout`. One pattern I've seen is a RAF associated with an element where the RAF is cleared (cancelAnimationFrame) if already registered. This can quickly result in TooManyTimers. This commit removes the timer from _timers as soon as it's canceled. It doesn't fully eliminate the chance of TooManyTimeout, but it does reduce it.