mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
Timers scheduled with identical `fire_time` could fire out of order because the heap is not stable. This change assigns a monotonically increasing `sequence_id` when a timer is scheduled and extend the heap comparator to order by (`fire_time`, `sequence_id`). This guarantees FIFO among timers with the same deadline. This matches the HTML "run steps after a timeout" ordering requirement: older invocations with <= delay complete before newer ones. https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#run-steps-after-a-timeout
436 B
436 B