Instead of creating a new single-shot timer every time a setInterval
timer reschedules itself, we now use a repeating Core::Timer internally.
This dramatically reduces timer drift, since the next timeout is now
based on when the timer fired, rather than when the timer callback
completed (which could take arbitrarily long since we run JS).
It's not perfect, but it's a huge improvement and allows us to play
DiabloWeb at full framerate (20 fps).
The User Timing, Resource Timing and Navigation Timing specifications
have not been updated to account for the queue method to also append to
the underlying performance buffer and it's method of checking it's
full.
This separates the functionality into a different function, with a flag
to indicate whether to use the custom full buffer logic or not.
Previously, they would stay open for the entire WebContent lifetime,
or until the server closed the connection. This was particularly
noticeable on collaborative websites/games such as
https://jigsawpuzzles.io/, where the user using Ladybird would stick
around even after they had navigated away.
Instead of always reporting a colno and lineno of zero try and use the
values from the Error object that may be provided, falling back to the
source location of the invocation if not provided. We can definitely
improve the reporting even more, but this is a start!
Also update this function to latest spec while we're in the area.
All global objects current need to be event targets so that they
can have events dispatched to them. This allows for removing of
verify_cast for these global objects.
Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:
* JS::NonnullGCPtr -> GC::Ref
* JS::GCPtr -> GC::Ptr
* JS::HeapFunction -> GC::Function
* JS::CellImpl -> GC::Cell
* JS::Handle -> GC::Root