Depends on https://github.com/lightpanda-io/libdom/pull/36
The spec says this should be a High Definition timestamp. But browsers avoid
that in order to avoid fingerprinting. By default, FireFox rounds to 2ms (which
is what this PR does).
Previously, the timestamp was seconds, so you'd think: isn't that better? Well,
it's pretty far off the spec and what browsers do, but more importantly, it
crashes our WPT test. If you look at `Event-timestamp-safe-resolution.html`
you'll see that it's trying to find the delta between two timestamps, in an
endless loop (without a loop of many iterations). With second-resolution, it
just takes too long (and crashes..memory).
This ensures that page.wait won't unblock too early. As-is, this isn't an issue
since active can only be 0 if there are no active OR pending requests. However,
with request interception (https://github.com/lightpanda-io/browser/pull/930)
it's possible to have no active requests and no pending requests - from the
http client's point of view - but still have pending-on-intercept requests.
An alternative to this would be to undo these changes, and instead change
Page.wait to be intercept-aware. That is, Page.wait would continue to block on
http activity and scheduled tasks, as well as intercepted requests. However,
since the Page doesn't know anything about CDP right now, and it does know
about the http client, maybe doing this in the client is fine.
libdom's parsing is now less strict with respect to attribute names. See:
https://github.com/lightpanda-io/libdom/pull/33
However, the attribute name in setAttribute has stricter validation applied to
it, which we now handle directly.
Add a callback to libdom which triggers whenever a script tag is added. Page
registers the callback AFTER the HTML is parsed, but before any JS is processed
and loads the script tags.
* Rework WPT runner
We have no crashing tests, remove safe mode. Allows better re-use of arenas,
and if we do introduce a crash, it won't be easy to ignore. Could allow for
re-using the environment across tests to further improve performance.
Remove console now that we have a working console api.
* Update workflows, add summary
Remove --safe option from WPT workflows (it's no longer valid)
Include a total test/case summary when --summary or --text (default) is used.
* remove wpt --safe flag from Makefile
* handle tests in the root of the test folder
* Fix a couple possible segfaults base on strange usage (WPT stuff)
* generate proper JSON
* generate proper JSON (for real this time?)
* fix tag type check
Updates zig-js-runtime to latest, reverting the loop reset change. This solves
the introduced memory leak.
On WPT error, call js_env.wait() to ensure all pending events are completed.
Without this, on error, the code is likely to crash as the timeout callback
executes AFTER env.deinit() is called. This is now possible to do safely on
Mac now that cancel is pseudo-implemented.
FlatRenderer positions items on a single row, giving each a height and width of
1.
Added getBoundingClientRect to the DOMelement which, when requested for the
first time, will place the item in with the renderer.
The goal here is to give elements a fixed position and to make it easy to map
x,y coordinates onto an element. This should work, at least with puppeteer,
since it first requests the boundingClientRect before issuing a click.