Add the reflected DOMString attributes name and value to the
existing HTMLParamElement, per HTML 15.3
(https://html.spec.whatwg.org/multipage/obsolete.html#htmlparamelement).
Mirrors the reflection idiom used by HTMLTimeElement / HTMLDataElement.
Advances the html/dom/reflection-obsolete.html WPT row.
Updates the `zenai` dependency to support safety finish reasons. Tracks
when a model refuses a request due to safety, prints a specific warning
message, and avoids re-prompting.
Extract ZigToCurlAllocator to its own file and rename it to CurlDebugAllocator
to indicate that it is only used in debug. Also, only use it in debug.
In release mode, this just adds 16 bytes of overhead per allocation that curl
makes. In debug mode, it's the same overhead, but it at least hooks into the
std's DebugAllocator which can detect misuse.
A lot of WPT tests do something like:
```js
const frame = document.createElement("iframe");
t.add_cleanup(() => {
frame.remove();
});
... run a test
```
But our frame.remove (Element.remove) doesn't destroy the frame/context. It
can't. We don't know what is referencing it. So these WPT tests that create
_thousands_ of these quickly run into TooManyContexts errors.
As a quick solution, we now allow up to 8K contexts to be created when running
WPT tests (`-Dwpt_extensions`). Env.contexts becomes an arraylist rather than
an arary (so avoid having to pay that 8192 * 64 byte penalty for tests that
don't need 8K contexts).
An example of such a test is: /encoding/unsupported-labels.window.html
- Add `recordRaw` to record raw JS lines in the REPL.
- Only record commands if they succeed without error.
- Fix kitty terminal cursor keys by forcing legacy arrow encoding.
Stacked on https://github.com/lightpanda-io/browser/pull/2604 and driven by
a different WPT test: /html/dom/reflection-metadata.html
Goes from 1527 to 3074 passing cases. Largely just adding more attributes and
adding validation to attributes where necessary.
From a real case involving a modified version of our bing integration. Our
`releaseRef` (release from v8) destroys the FinalizerCallback.Identity but kept
it in the identities list. `releaseRef` now removes it from the list, so that
when FC.deinit is called, it doesn't try to access the freed identity.
Aimed at improving WPT /html/dom/reflection-obsolete.html Goes from 923 to 2305
passing cases (the remaining failing cases are all for <frame> which we don't
currently support)
Add accessors to Directory, Font and FrameSet. Add HTMLMarqueeElement.
Font setColor null -> ""
Add new properties to Html (accessKey and autofocus) and improve tabIndex
parsing.
Drains and prints console messages during the REPL loop. This ensures
console output is surfaced in JS mode, where slash commands like
`/consoleLogs` are unreachable.
Arena reuse/retain can hide UAF issues, often resulting in a crash that is more
symptom than cause (far from where the error actually is). Removing this, lets
us better utilize the DebugAllocator's UAF-detection.
Also, when running WPT tests (-Dwpt_extensions) limit console logging to 100
values (a few tests writer millions of values, which is annoying and just
destroys the terminal).
56181bbe6c protected against a document.write
generating a document.write.
This protects against a document.write generating a document.close. We cannot
immediately close, so we 'queue' the close (via a boolean) and defer it until
the write is complete.
Fixes crash in WPT: /html/webappapis/dynamic-markup-insertion/document-write/iframe_010.html
From what I can tell, this is the last one of these.
Depends on https://github.com/lightpanda-io/zig-v8-fork/pull/179
An improvement to https://github.com/lightpanda-io/browser/pull/2515 to prevent
a v8 assertion if we terminate as an inspector dispatch is happening.
The problem is that if we just immediately terminate, we aren't sure what the
worker thread is doing, and, apparently, if we terminate then dispatch a message
to the inspector, we fail an assertion.
With the way the code was, the only safe solution would be to hold a mutex
over the session dispatch, but that could block the network thread.
So instead of terminating from the network thread, we now ask v8 to execute
a callback. This gets executed on the worker thread, which can then terminate
the execution.
The initial version of 2515 delayed the termination from the network thread.
It's possible that solution would "solve" the issue, simply because it's very
unlikely that a worker would be "stuck" for 5 seconds and then get unstuck.
More likely that it exits immediately, or is stuck in an endless loop. But
that would still leave a window where we could terminate in network and then
dispatch in the worker. Less likely, but still possible. Hopefully this new
mechanism eliminates this from being a problem in all circumstances.
Consolidates the switch block in `extractArgs` to extract the schema
string first before wrapping it. Simplifies `extractSchemaString` by
reusing `normalizeExtractSchemaString` for array schemas.
Use the current isolate context instead of the receiver's context
when invoking primitives, fixing failures in strict-mode scripts.
Also, explicitly perform a microtask checkpoint after running a
script to ensure promise continuations run.
Removes the `--self-heal` CLI option, the `scriptStep` and `scriptHeal`
MCP tools, and associated verification/iterator machinery. Replaces
"PandaScript" terminology with "slash commands" and moves shared
helpers to `tools.zig`.
BREAKING CHANGE: The `--self-heal` CLI flag and the `scriptStep` and
`scriptHeal` MCP tools have been removed.