Commit Graph

5712 Commits

Author SHA1 Message Date
Adrià Arrufat
ca1f2c0854 build: port sqlite3 to zig build system 2026-04-22 07:52:10 +02:00
Karl Seguin
7511ee6a3d Merge pull request #2198 from lightpanda-io/nikneym/cookie-lookalike-domain
`Cookie`: require label boundary when matching domain attribute
2026-04-22 13:06:17 +08:00
Karl Seguin
00ca20b485 Merge pull request #2200 from lightpanda-io/page_to_frame
Page to frame
2026-04-22 09:08:42 +08:00
Karl Seguin
2275416505 Page -> Frame
This is to pave the way for introducing a new "Page" container, which will take
over the page lifecycle currently burdening Session. The ultimate goal of that
is to allow the Session to have multiple pages (mostly for better transitions
between pages), which is hard to do now since the Session has so much state.

This rename was aggressive, e.g. currentPage() -> currentFrame() so that, when
the new Page container is added, you won't see "currentPage()" and wonder:

  "Does 'currentPage' mean the new Page container, or the Frame (which
  used to be called Page)".
2026-04-22 08:42:18 +08:00
Karl Seguin
b08e347661 page.frames -> page.child_frames
More prep work. So that we have frame.child_frames and not `frame.frames`.
2026-04-22 06:30:23 +08:00
Karl Seguin
842affd83b Pre-op for Page -> Frame rename
Rename page.id -> page._loader_id and propagate the change throughout. This was
my attempt at pretending that page.id (and page._frame_id) weren't CDP-sepcific.
But they are, and it's a lot cleaner to treat them this way. Might seem
unnecessary, but without this, after page -> frame, you'd end up with:

frame.id
frame._frame_id

Which is weird? What is `frame.id` if it isn't the frame id and if that's the
case, what's frame_id? Now it'll be:

frame._loader_id
frame._frame_id

Which removes the ambiguity, makes the CDP code a bit more obvious, and doesn't
try to hide the fact that these are CDP things that, for now at least, pollute
the code a little.
2026-04-22 06:30:23 +08:00
Karl Seguin
650c0cbd28 Merge pull request #2196 from lightpanda-io/sqlite
Sqlite
2026-04-22 06:30:00 +08:00
Karl Seguin
bfb5ea1d94 Merge pull request #2201 from lightpanda-io/worker_apis
More worker APIs
2026-04-22 06:28:53 +08:00
Karl Seguin
9b96d4f7f4 Merge pull request #2202 from lightpanda-io/clone_shared_buffer_error
Add error-callback on shared buffer clone from v8
2026-04-22 06:28:41 +08:00
Karl Seguin
5731429200 Merge pull request #2205 from lightpanda-io/cdp_timing_fields
Add timing fields to a few CDP messages
2026-04-22 06:28:28 +08:00
Karl Seguin
6a6a28ede5 Merge pull request #2204 from lightpanda-io/shrink_screenshot
Shrink screenshot.png
2026-04-21 18:39:26 +08:00
Karl Seguin
686591baed fix wrong method name, ugh 2026-04-21 17:49:59 +08:00
Karl Seguin
8294ad4921 Add timing fields to a few CDP messages
Hopefully fixes https://github.com/lightpanda-io/browser/issues/2199

Adds requestTime to responseReceived and, for completeness, adds timestamp and
wallTime to requestWillBeSent.
2026-04-21 17:40:36 +08:00
Karl Seguin
33f8905f1d Shrink screenshot.png
I asked claude to do for the png what it did for the pdf. The savings aren't as
big AND, it isn't as nice as the original.

I'm tempted to say we should keep the original, but I don't feel strongly about
it and maybe saving a few KB is worth it?
2026-04-21 17:10:26 +08:00
Karl Seguin
7c9dce2a39 Add error-callback on shared buffer clone from v8
With our current "null" cullback, trying to clone a shared buffer crashes. The
callback throws an error.

Fixes a WPT crash:
/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html
2026-04-21 17:00:31 +08:00
Karl Seguin
a38e21278f More worker APIs
WritableStream*, ReadableStream*, Blob, TextDecoderStream, TextEncoderStream
and TransformStream all migrated from depending on Page to Execution.
2026-04-21 16:04:19 +08:00
Pierre Tachoire
9df41fdeb0 Merge pull request #2197 from lightpanda-io/fake-printopdf
cdp: implement a fake Page.printToPDF
2026-04-20 17:54:49 +02:00
Pierre Tachoire
fbb93e7d53 cdp: implement a fake Page.printToPDF
Similar to Page.captureScreenshot
This is useful for tools integration calling this method, returning a
fake result instead of an error.
2026-04-20 16:52:24 +02:00
Karl Seguin
ef2e42292f Merge pull request #2195 from lightpanda-io/import_string
@import(".....string.zig").String => lp.String
2026-04-20 21:58:03 +08:00
Halil Durak
780bf8cbc5 Cookie: update tests 2026-04-20 16:47:28 +03:00
Halil Durak
9ed39e4c3e Cookie: check for either exact match or dot-prefixed domain 2026-04-20 16:47:20 +03:00
Karl Seguin
e7be3c8b14 still trying to get this test to pass 2026-04-20 18:57:45 +08:00
Karl Seguin
55d7bae943 more busy timeout tricks 2026-04-20 18:42:55 +08:00
Karl Seguin
fcd3d1cd14 Use unsafe journal_mode during Pool test
Can't use WAL, as it thread sanitizer reports false positives. The default,
delete, causes busy timeouts. Let's try the unsafe memory!
2026-04-20 18:14:29 +08:00
Karl Seguin
b226a9ed52 Disable WAL mode for Sqlite pool test
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
2026-04-20 17:16:42 +08:00
Karl Seguin
6d0003ad2b Sqlite
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.
2026-04-20 17:13:06 +08:00
Karl Seguin
b08ae07598 build with sqlite3, just to see how it behaves in the CI 2026-04-20 15:43:49 +08:00
Karl Seguin
1fade8d375 Merge pull request #2193 from lightpanda-io/worker_apis
Enable more WebAPIs for Workers
2026-04-20 15:30:54 +08:00
Karl Seguin
782ed50c83 @import(".....string.zig").String => lp.String
Similar change to https://github.com/lightpanda-io/browser/pull/2194 but for
String.
2026-04-20 15:29:37 +08:00
Karl Seguin
a8490b1803 Enable more WebAPIs for Workers
Request, Response, Headers and FormData.
2026-04-20 15:10:47 +08:00
Karl Seguin
c159be503a Merge pull request #2194 from lightpanda-io/import_log
Change all @import("...../log.zig") to const log = lp.log;
2026-04-20 15:07:15 +08:00
Karl Seguin
6e02e41ad3 zig fmt 2026-04-20 14:22:48 +08:00
Karl Seguin
3e8b63aa1b Merge pull request #2184 from lightpanda-io/perf-axnode-scratch-arena
ax: route AXNode.Writer scratch allocations through a dedicated arena
2026-04-20 14:22:04 +08:00
Adrià Arrufat
983e592b43 cdp: use page arena pool for AXNode writer 2026-04-20 07:42:08 +02:00
Karl Seguin
2d20e57f80 Change all @import("...../log.zig") to const log = lp.log;
@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.
2026-04-20 12:40:04 +08:00
Karl Seguin
908e075974 Merge pull request #2192 from lightpanda-io/fix_document_write_tests
Fix document.writeln test
2026-04-20 10:43:24 +08:00
Karl Seguin
1c8c68f3d9 Fix document.writeln test
Broken scoping.
2026-04-20 10:25:58 +08:00
Karl Seguin
3ceb28eab3 Merge pull request #2190 from lightpanda-io/async_test
Remove remaining "legacy" async tests.
2026-04-20 10:25:19 +08:00
Karl Seguin
98abe3fc92 Merge pull request #2191 from lightpanda-io/feat/timer-string-handler
Feat/timer string handler
2026-04-20 10:11:34 +08:00
Karl Seguin
728f2f2945 uncomment and fix some animation tests 2026-04-20 10:11:00 +08:00
Karl Seguin
20531b0f87 try to fix flaky CI test 2026-04-20 10:06:09 +08:00
Karl Seguin
9a6875f1b5 Prefer union over js.Value type checking
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.
2026-04-20 09:51:42 +08:00
Karl Seguin
6e989ad5b8 Remove remaining "legacy" async tests.
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.
2026-04-20 09:35:33 +08:00
Karl Seguin
3ad683121b Merge pull request #2183 from lightpanda-io/wpt_extensions
Add WPT extensions
2026-04-19 07:08:34 +08:00
Pierre Tachoire
b4cd263459 Merge pull request #2188 from luckyyyyy/feat/document-writeln
feat(document): implement document.writeln
2026-04-18 14:19:42 -04:00
Karl Seguin
24b86a847c Merge pull request #2179 from lightpanda-io/websocket_fixes
Websocket fixes.
2026-04-18 10:06:12 +08:00
Karl Seguin
0b598cfcc5 Merge pull request #2180 from lightpanda-io/update_html5ever
This updates html5ever and the other Rust dependencies.
2026-04-18 10:02:24 +08:00
Karl Seguin
fb9e1d91a5 Merge pull request #2181 from lightpanda-io/blob_constructor
Support more types in new Blob(...)
2026-04-18 10:02:20 +08:00
Karl Seguin
4b701aa978 Merge pull request #2185 from lightpanda-io/cookies_and_friends_fix
Improve Cookie parsing rules
2026-04-18 09:40:50 +08:00
Pierre Tachoire
360a3abfe1 Merge pull request #2186 from mvanhorn/docs/2166-alpine-glibc-note
docs: note glibc requirement in Linux install instructions
2026-04-17 21:25:43 -04:00