It seems like there are known false positives with thread sanitizer and sqlite.
(There are various references to this in sqlite's wal.c and also possibly
related https://bugzilla.mozilla.org/show_bug.cgi?id=1153409
This adds an app.storage which is a union around configurable storage engine
(currently, only sqlite).
It is _not_ being used anywhere right now. The goal is to get feedback on
the implementation and then move cache to it.
This doesn't expose a generic query API. The goal is that the storage will
expose high level methods, e.g. `cacheGet(req: CacheGetRequest)` and every
storage engine will translate the `storage.CacheGetRequest` as needed.
A thin wrapper around the Sqlite C api is included, e.g. exec(SQL, .{args}) a
`rows` and `row` fetcher. A connection pool is included. By default, an
in-memory DB is currently created. And a `migrations` table with an id of `1`
is created/inserted. I don't imagine needing fancy migratations.
@import("lightpanda") where needed.
Would also like to do this for String, Page, Session and js which all stand out
as types that are use across the codebase.
I know that a few devs are doing this in new work and I haven't heard anyone
voice an objection.
Allow mapping js input to a js.String (previously, had to be either a []const u8,
an SSO, or a js.Value). Allow compileFunction to be called directly with a
js.String.
Follow up on https://github.com/lightpanda-io/browser/pull/2179 to remove
the remaining "legacy" async tests (I didn't realize there were only 2 more
files, should have done it all in that commit). Also, slightly improve how
these async tests work in Chrome/FF.
The HTML spec defines `TimerHandler` as `Function or DOMString`, and
the string form is still widely used by legacy sites and server-rendered
pages (e.g. clocks that do `setInterval("updateTime()", 1000)`).
Previously the binding signature required `js.Function.Temp`, so passing
a string threw `TypeError: invalid argument` and aborted page scripts.
Accept `js.Value.Temp` instead, then resolve the handler per spec:
* Function -> persist as-is (unchanged behavior).
* String -> compile as the body of an anonymous function via
`Local.compileFunction`, mirroring what the existing
`Context.stringToPersistedFunction` helper does for
HTML attribute event handlers.
* otherwise -> `InvalidArgument` (TypeError, same as before).
Tests added to window/timers.html:
* setTimeout(string) runs the compiled code.
* setInterval(string) fires at least once and is cancellable.
* non-function / non-string handler still throws TypeError.
Spec: https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
Document.writeln was not registered on the DOM prototype, so legacy
scripts that rely on it (e.g. script loaders that inject <script> tags
via `document.writeln`) crashed with `document.writeln is not a
function` and prevented the rest of the page from running.
Per HTML spec, writeln runs the document write steps with the joined
argument text followed by a U+000A LINE FEED character. Implement it
by sharing the existing write pipeline so all InvalidStateError and
parser behavior is identical to write().
Tests added to document/write.html covering:
- writeln appends a trailing newline text node after the written nodes
- multiple arguments are concatenated before the newline is appended
Spec: https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-writeln
Closes#2166
The Linux release binary is linked against glibc, so musl-based distros
(Alpine and similar) hit 'cannot execute: required file not found' on
first run because the glibc dynamic linker is missing.
Adds a note to the install section directing Alpine users to a
glibc-based base image or the build-from-sources path.
This commit was focused on making small changes to cookie parsing in order to
improve a handful of WPT cases.
Protects against nameless cookies that have a value with certain prefixes (e.g.
`__Secure-`) which could be pased into an incorrect prefix.
It allows tabs in cookie names/values.
It enforces that certain prefix have certain settings.
Along the way:
- Added window.origin
- Ensure URL passed to Request is escaped
- Added log on fetch error
- made --dump wpt only list non-passing results