Commit Graph
8095 Commits
Author SHA1 Message Date
Karl Seguin 4c8e2f20bf v8: update to latest stable release 15.5.35.13
Depends on https://github.com/lightpanda-io/zig-v8-fork/pull/215 and
https://github.com/lightpanda-io/pkg/pull/3
2026-09-30 11:23:47 +08:00
Karl Seguin 7d558af4f3 Merge pull request #3685 from staylor/fix/image-natural-dimensions
Report natural dimensions for fetched images
2026-09-30 08:06:16 +08:00
Karl Seguin d6de5fee8e Merge headers_only and headers_only_prefix_bytes into a single optional
`partial: ?u32 = null` is now the tristate to capture (1) load everything (null)
(2) load no body (0) and  (3) load N body (N).

partial responses are NOT sent to CDP - the data can be garbage.

read orientation of jpeg and swap height/width as needed
2026-09-30 07:34:38 +08:00
Karl Seguin 7d812cea2e Downgrade ExecutionTerminated to debug
Detect closed peer so that subsequent sends don't keep trying and failing
2026-09-30 07:07:05 +08:00
Karl Seguin 5eaebc9235 ops: downgrade many warn/err logs -> debug
Meant to be merged alongside https://github.com/lightpanda-io/browser/pull/3680
but split up to make it easier to review.

317 of the 554 warn/err are now debug. Many of these are events that might be
interesting to a lightpanda browser developer, but not so much an end-user (
end-users might still care about some of these, but more likely in the aggregate
via metrics).

The ultimate goal is to make --log-level warn a useful default.

(this also tweaks how the page meta data is displayed in the pretty logs)
2026-09-30 07:07:04 +08:00
Karl Seguin ef675bcf0b Merge pull request #3680 from lightpanda-io/page-context-logs
ops: Introduce Page Context logs
2026-09-30 07:02:40 +08:00
Karl Seguin 55d06d87e6 Merge pull request #3682 from lightpanda-io/ignore-invalid-mime
http: CDP ignore invalid content-type message
2026-09-30 07:02:26 +08:00
Karl Seguin e9da22ec99 Merge pull request #3674 from lightpanda-io/public-suffix-list
chore: generated public suffix list
2026-09-30 07:01:48 +08:00
Scott Taylor 009225ace1 Report natural dimensions of fetched images from a bounded header prefix 2026-09-29 14:43:46 -04:00
Karl Seguin 68ff1a4322 http: CDP ignore invalid content-type message
Saw a site return "Content-Type: charset=UTF-8;charset=UTF-8" on scrape. Not a
valid header and it correctly fails to parse. Except...CDP fails to RI on these
since it tries to parse and bubbles. Safe to swallow this error here and
continue with the response serialization.
2026-09-29 15:46:55 +08:00
Karl Seguin d8586751d0 ops: Introduce Page Context logs
Ultimate goal is to improve the logging to be more useful by:
1 - identifying the page being navigating
2 - downgrading most page-loading errors to debug
3 - provide page statistics (in logs, via cdp).

So, the logs would look something like:

```
info page-navigate page=3392 url=https://.....
debug urlblocked page=3392
debug timeout page=3392 url=script.js
info page-done page=3392 url=https://....
```

The log level for page-done will be  the @max() of any log level for that page
so that if you run --log-level warn, and you get:

```
info page-navigate page=3392 url=https://... <-- filtered out
debug timeout page=3392 url=script.js <--filtered out
warn unknown module lookup page=3392 identifier=blah.js
warn page-done page=3392 url=https://....
```

So that any page event can be linked to the top leveL URL, while still
respecting the --log-level.

This first parts adds the log-level page context, and the thread local
variable.
2026-09-29 12:17:39 +08:00
Karl Seguin a3455967ce Merge pull request #3644 from lightpanda-io/headers-on-sync-xhr
Add headers to SyncRequest Path
2026-09-29 08:56:23 +08:00
Karl Seguin 1765de7244 chore: generated public suffix list 2026-09-29 08:49:52 +08:00
Karl Seguin 1dbf03e088 don't get arena if it isn't needed 2026-09-29 08:34:41 +08:00
Muki Kiboigo a23da281f4 update comment about arena in SyncContext 2026-09-29 07:49:07 +08:00
Muki Kiboigo 7d2dfef5c2 add test for sync XHR headers check 2026-09-29 07:49:07 +08:00
Muki Kiboigo 93ef6eb7bf move body ensure capacity before optional header copy 2026-09-29 07:49:07 +08:00
Muki Kiboigo 1dfd8ef89e use std.mem.eql in XHR header checking 2026-09-29 07:49:07 +08:00
Muki Kiboigo f786c18055 include header copy option to sync requests 2026-09-29 07:49:07 +08:00
Muki Kiboigo b7c17c9cb4 add headers to SyncResponse and XHR 2026-09-29 07:49:05 +08:00
Karl Seguin b74c20d1a7 Merge pull request #3614 from lightpanda-io/viewport-scroll-extent
Give the document a height and clamp the viewport scroll to it
2026-09-29 07:10:01 +08:00
Karl Seguin 5932638baf Merge pull request #3671 from lightpanda-io/status-text
webapi: xhr/fetch report status reason from server
2026-09-28 22:43:27 +08:00
Karl Seguin 1cab72edcd Merge pull request #3670 from lightpanda-io/default-sanitizer
mem: remove allocation for default sanitizer
2026-09-28 22:43:15 +08:00
Pierre Tachoire be65962d68 testing: remove unused func 2026-09-28 14:04:11 +02:00
Adrià Arrufat 45a74e567f Only inline heights extend the document
Resolving the cascade for every element on each mutation made an
append + scrollHeight read up to 12x slower. Virtualizers set their
spacer height inline.
2026-09-28 13:25:09 +02:00
Karl Seguin f7fbc2f34f webapi: xhr/fetch report status reason from server
If the server gives a status reason, report it as-is. Only default to the
zig code->reason map when one isn't given.

Also, don't force a 407 status code when auth_challenge is present.
2026-09-28 19:01:39 +08:00
Pierre Tachoire cebd8e3690 cors: fix unit tests when enabling cors by default 2026-09-28 12:23:29 +02:00
Karl Seguin 3ca791be4d fix typo 2026-09-28 18:16:46 +08:00
Karl Seguin 1cf025bcc8 mem: remove allocation for default sanitizer
https://github.com/lightpanda-io/browser/pull/3619 added proper support for
Sanitizer. A consequence of that is that every setHTML/parseHTML without an
explicit creates the default Sanitizer (with its ~300 entries).

This commit creates 1 app-level default sanitizer and uses it, internally, when
none is explicitly given. The sanitizer is immutable so can safely be used
across threads.
2026-09-28 18:12:08 +08:00
Pierre Tachoire 8d6ebf0635 replace --disable-cors by --disable-features cors 2026-09-28 12:03:18 +02:00
Pierre Tachoire 12d3880d20 enable cors by default
keep `--experimental-features cors` available for BC.
add `--disable-cors` option.
2026-09-28 12:03:18 +02:00
Karl Seguin 58357fea3e Merge pull request #3529 from lightpanda-io/nikneym/improve-cdp-error
`cdp`: report back invalid same-site
2026-09-28 16:20:45 +08:00
Karl Seguin 8a3bd6d4b2 Merge pull request #3663 from lightpanda-io/markdown-anchor-no-href
Treat <a> without href as text in markdown and clutter strip
2026-09-28 16:18:12 +08:00
Karl Seguin cfad479548 Merge pull request #3649 from lightpanda-io/cli-suggest-threshold
cli: scale the "did you mean" distance with the input's length
2026-09-28 16:05:53 +08:00
Karl Seguin 3aaed28d20 Merge pull request #3666 from lightpanda-io/domtokenlist-setters
webapi: add a number of DOMTokenList setters
2026-09-28 15:40:48 +08:00
Adrià Arrufat 51b9ee8125 Extend the document to nested declared heights
A spacer inside an auto-height wrapper, as virtualized lists build,
counted as 5px, so the viewport clamp stopped short of it.
2026-09-28 09:40:32 +02:00
Karl Seguin 915bf31622 Merge pull request #3667 from lightpanda-io/silence-test-logs
chore: silence expected error log in test
2026-09-28 15:39:42 +08:00
Karl Seguin 1bb4aba7fa Merge pull request #3668 from lightpanda-io/flaky-test-fix
ci: fix flaky test
2026-09-28 15:39:29 +08:00
Karl Seguin fd4eaeb01c Merge pull request #3669 from lightpanda-io/M_MMAP_THRESHOLD
mem: Set M_MMAP_THRESHOLD to 128K on linux builds
2026-09-28 15:39:13 +08:00
Karl Seguin cbc9c79afd Merge pull request #3664 from lightpanda-io/always-detach-global
v8: always detach global
2026-09-28 15:38:12 +08:00
nikneym 96d0f07b15 cdp: setCookie sameSite parity with Chrome 2026-09-28 10:27:32 +03:00
Adrià Arrufat b8a6994baf markdown: keep standalone href-less anchors on their own line
Adjacent placeholder anchors, like a JS-driven nav, ran together as
HomeAbout. Keep the standalone line placement linked anchors get and
drop only the link syntax.
2026-09-28 09:27:16 +02:00
Adrià Arrufat 1188554515 cli: read a url-like bare word as the url, not a misspelt command
`lightpanda version.io` was rejected as a misspelt `version`, 3 edits
within the length-scaled limit. Like curl, it fetches now: the command check
shares --dump's isUrlLike.
2026-09-28 09:22:29 +02:00
Karl Seguin 4caaa27411 mem: Set M_MMAP_THRESHOLD to 128K on linux builds
Following some experimentation, this sets M_MMAP_THRESHOLD to 128K on linux
builds IF it isn't explicit set, e.g. via the `MALLOC_MMAP_THRESHOLD_` env. This
allows users explicitly set it if they want.

I've been looking at this for a while, but my understanding is still basic. The
simplistic explanation is that glibc's allocator internally uses arenas.
Allocations above THRESHOLD skip these arenas and are allocated directly from
and freed directly to the OS. Allocations under this threshold are released
to the arena where they can be re-used. Everything works OK, EXCEPT for when it
comes time to release the memory from these arenas back to the OS. If free arena
memory is pinned under live memory, it cannot be released.

Various online posts / comments reference glibc as suffering from significant
fragmentation and "holding" onto memory. That's the behavior that we've seen.
Further, calls to malloc_trim reclaim the lost memory, so what we're seeing
aren't leaks.
2026-09-28 14:02:39 +08:00
Karl Seguin 58622ef7c4 Merge pull request #3571 from lightpanda-io/nikneym/playwright-id-track
`cdp`: answer inspector commands on the session that sent them
2026-09-28 12:36:44 +08:00
Karl Seguin e79c85a587 Merge pull request #3653 from staylor/fix/stylesheet-important-cascade
Honor !important when cascading tracked stylesheet properties
2026-09-28 12:23:02 +08:00
Karl Seguin 9aa748616b Simplify Inspector.Session ownership
Since AttachedSession is already heap-based, it's inspector_session is at a
fixed address and thus can own the session.

Also, hook in some noop callbacks on deinit.
2026-09-28 12:18:33 +08:00
Karl Seguin 46d16e229e Store !important as priority
Encode the !important'ness of a rule into its priority (we have the bit to
spare). This keeps the !important calculation the build-side, not the read side
and is more consistent with how the StyleManager generally works.

CSSStyleDeclaration `getPropertyValue` is now !important aware. Whereas before
an inline value would always win, it now cedes to an !important stylesheet rule
2026-09-28 11:55:34 +08:00
Karl Seguin ce46f90f1c Merge pull request #3657 from onnimonni/fix/input-select-email
webapi: input select() must not throw for email/number
2026-09-28 10:35:38 +08:00
Karl Seguin 72d612472d ci: fix flaky test 2026-09-28 10:34:59 +08:00