Commit Graph
9525 Commits
Author SHA1 Message Date
Karl Seguin ddf0fa2ce9 Merge pull request #3538 from lightpanda-io/webdriver-navigate
WebDriver: add navigate
2026-09-17 07:37:36 +08:00
Karl Seguin bc5f0777fb Merge pull request #3540 from lightpanda-io/cors-redirect-credentials
webapi: limit redirect with credentials
2026-09-17 07:24:18 +08:00
Karl Seguin 01d07afe94 Merge pull request #3523 from lightpanda-io/stylesheet-scroll-container
Resolve scroll containers through the style cascade and unify wheel dispatch
2026-09-17 07:21:50 +08:00
Karl Seguin 722525289c Merge pull request #3512 from lightpanda-io/service-worker
webapi: experimental (and useless, for now) ServiceWorker
2026-09-17 07:21:27 +08:00
Adrià Arrufat e7d151d982 Simplify the overflow and wheel changes
The overflow shorthand split lives once, in the CSS parser, for both the
style declaration and the StyleManager attribute fold; the two copies
disagreed on three-value input. The declaration states the longhand-pair
rule once and serializes the pair where its first longhand sits without
a second scan. The two listener scans merge into one with a filter. The
per-axis scroll walk goes: the cascade memoizes each element, so calling
the single-axis walk twice costs a few lookups.
2026-09-16 15:27:35 +02:00
Adrià Arrufat b0f6066be7 Store the overflow shorthand as its longhands
setProperty updated an existing entry in place, so on
style="overflow: hidden; overflow-y: scroll" a later
setProperty("overflow", "hidden") left overflow-y winning, and
removeProperty("overflow") left it behind. Now that the cascade folds
overflow, that showed up as a stale scroll container.

The declaration object stores overflow the way the CSSOM does for every
shorthand: set and parse expand it into overflow-x and overflow-y,
remove drops both, and reading or serializing recombines them when both
are present with the same priority. It is the one shorthand handled this
way because it is the one whose longhands StyleManager tracks.
2026-09-16 15:15:02 +02:00
Adrià Arrufat 6fb46ca224 Fire mousewheel only where no wheel listener is registered
Blink does not dispatch a second event for the legacy name. Per target,
it runs the wheel listeners if there are any, else the mousewheel ones
with the event retyped for the call. A target registering both never
sees mousewheel. The event manager now does the same for trusted
events, so one wheel dispatch covers both names and the fallback also
decides what counts as a non-passive listener on the path.
2026-09-16 15:07:55 +02:00
Adrià Arrufat 057738ef2a Resolve scroll-blocking cancelability on the dispatch path
hasNonPassiveListener walked parentNode up to the window, which is not
the path an event takes: it missed shadow hosts, composed retargeting
and inline handlers. The wheel and touch dispatchers now flag the event
as cancelable-unless-passive and dispatchNode resolves the flag against
the path it just built.
2026-09-16 15:03:40 +02:00
Adrià Arrufat 9fe7f37e91 Drop the allInline early exit from the cascade scan
With six tracked properties an element declaring all of them inline is
not a case worth a branch; checkRules already skips rules nothing weaker
than inline could beat.
2026-09-16 15:01:28 +02:00
Adrià Arrufat c2e4d13730 Keep the scroll target types and wheelScroll file-private
ScrollTarget and ScrollTargets are only named inside Element.zig; callers
switch on the result or call scrollBy through it. wheelScroll has one
caller, wheel, in the same file.
2026-09-16 15:00:50 +02:00
Adrià Arrufat 2cc537fc8c Merge branch 'main' into stylesheet-scroll-container 2026-09-16 14:53:52 +02:00
Karl Seguin c876be0d4a immediately check for active worker 2026-09-16 20:37:35 +08:00
Karl Seguin f0e919052f remove unneeded 'pub' 2026-09-16 20:30:27 +08:00
Karl Seguin 2648b3067c Merge pull request #3539 from lightpanda-io/indexeddb-double-free
crash: fix double free in indexeddb
2026-09-16 20:23:13 +08:00
Karl SeguinandPierre Tachoire 9f77b79121 Apply batched suggestions from code review
Co-authored-by: Pierre Tachoire <pierre@tch.re>
2026-09-16 20:21:36 +08:00
Karl Seguin 256cbb8a2b rework test so they wait on a promise rather than 50ms, which timesout on the ci 2026-09-16 17:49:10 +08:00
Karl Seguin dc1ae129e3 webapi: experimental (and useless, for now) ServiceWorker
This adds the shell for ServiceWorker, behind
`--experimental-features serviceworker`.

It's pretty useless as-is. We don't have the CacheStorage API (next) and don't
have the fetch interceptor (next next). But as-is, the change is quite big but
thankfully largely isolated.
2026-09-16 17:49:07 +08:00
Karl Seguin b15707973b webapi: limit redirect with credentials
A cors request with credentials can only follow redirects when staying on the
same origin. WPT cors-redirect-credentials
2026-09-16 17:41:32 +08:00
Karl Seguin afbc8378b1 Merge pull request #3522 from lightpanda-io/regex-shared
`Regex`: share the PCRE2 wrapper; `findElement` matches names by `/regex/`
2026-09-16 16:55:40 +08:00
Karl Seguin 828130fdcd Merge pull request #3530 from staylor/fix/superseded-document-lifecycle
Stop load events on a document superseded by navigation
2026-09-16 15:46:01 +08:00
Karl Seguin 482ea04292 crash: fix double free in indexeddb
Add state to OpenContext so that the owner is tracked known and other flows
don't free (cancelPark doesn't free when the context is running, since run will
take care of it)
2026-09-16 15:42:09 +08:00
Adrià Arrufat 90487270ba findElement: the name filter is one union; a literal is one by grammar
A name is a substring or a regex, never both, so the filter says so
instead of carrying two optionals the caller has to null against each
other. Whether `/.../x` is a literal is now decided by JavaScript's flag
alphabet rather than "looks like letters", which stops `/usr/bin` from
being read as a pattern with flags. Comments that narrated callers or
the type name are gone; the literal parser gets its own test in place
of two MCP round-trips.
2026-09-16 09:38:42 +02:00
Adrià Arrufat 5710f1d684 findElement: accept the flags of a JavaScript regex literal
A model that writes `/spice/i` should not be told the name has a
stray `i` in it. `i` and `u` are already how names match, `s` and `m`
map to their PCRE2 options, and any other letter is a tool error that
names it. Text after the closing slash that is not a letter makes the
whole thing a plain substring again.
2026-09-16 09:29:18 +02:00
Adrià Arrufat 35dbda3686 Regex: compile through the context
The context is what a pattern is compiled against, so `compile` reads
better as its method than as a free function taking it first.
2026-09-16 09:28:45 +02:00
Karl Seguin 21a210fe16 Narrow frame suspension
The original work was aimed at ensuring that a page which is being navigated
away doesn't trigger events that it shouldn't, i.e. `DOMContentLoaded` and
`load`.

This just narrows down the scope of that little, for example ensuring the new
page actually gets its navigate() off being signaling the old page to abort.
2026-09-16 14:08:11 +08:00
Karl Seguin 7ecefa9e92 WebDriver: add navigate
This feature is significant because it adds support for processing an HTTP
request via the worker. It requires parking the connection and then having the
worker notify the loop when the response is ready. A lot of this was already
in-place (e.g. worker -> loop notification) but not quite do this extent.
2026-09-16 14:05:49 +08:00
Karl Seguin d52957b2e2 Merge pull request #3533 from staylor/fix/fatal-signal-backtrace
Record Linux fatal signals without blocking on stderr
2026-09-16 13:59:29 +08:00
Karl Seguin b3b663ce43 fix ci 2026-09-16 13:10:52 +08:00
katie-lpd ec0c69a1ad Merge pull request #3537 from lightpanda-io/katie-lpd-patch-1
Update README.md
2026-09-16 06:47:33 +02:00
katie-lpd 6d5afb0c51 Update README.md 2026-09-16 06:47:08 +02:00
katie-lpd b492ffb684 Update README.md 2026-09-16 06:46:40 +02:00
Karl Seguin 7b7c7d7b0b Expand to destination to all stderr destination
Attempt to add backtrace information

If there's no PATH, look for curl in known locations. (this is unrelated, but
there's overlap with this work and the special `segv-crash-report` that we're
using in debugging, and i wanted to bring this specific part over).
2026-09-16 11:47:40 +08:00
Karl Seguin f141b458cd Merge pull request #3521 from lightpanda-io/js-value-serialization
internal: simplify v8.Value serialization
2026-09-16 11:35:52 +08:00
Karl Seguin 3eb1fcbc12 update v8 dep 2026-09-16 10:12:27 +08:00
Karl Seguin ea0443cec9 internal: simplify v8.Value serialization
Requires: https://github.com/lightpanda-io/zig-v8-fork/pull/207

Inspired by https://github.com/lightpanda-io/browser/pull/3504 this simplifies
v8::Value serialization (e.g. as used in console.log(...)).

1 - It doesn't executes JS and thus can't have a side effect, which is otherwise
    possible if we invoke a getter or through a proxy

2 - It removes the debugValue debug-only path

(2) is potentially a loss in debug builds, but I think the usefulness of that
was always, at best. The upside is code elimination and consistency in how
values are reported in debug/release
2026-09-16 10:12:27 +08:00
Karl Seguin 9cc702f4a4 Merge pull request #3535 from lightpanda-io/orderfile-regen
orderfile: regenerate the hot-code profile
2026-09-16 09:19:01 +08:00
Karl Seguin 6d87fbf0e9 Merge pull request #3526 from staylor/investigate/localization-400
Drop body headers when redirects switch to GET
2026-09-16 09:06:40 +08:00
github-actions[bot] 38a6fdca39 orderfile: regenerate the hot-code profile
hot set 14900KB resident at 4KB fault-around: 21224 text, 21827 rodata symbols
2026-09-16 01:04:53 +00:00
Karl Seguin 3864c1be3e Merge pull request #3518 from staylor/investigate/drops-watchdog-stall
Avoid spurious mutations for unchanged CSS declarations
2026-09-16 08:13:43 +08:00
Scott Taylor 45eb267f5c cssom: only sync the style attribute when a declaration changes
setProperty, removeProperty and cssFloat rewrote the style attribute
unconditionally, so assigning a property its current value, or removing
one that was never set, produced an attribute mutation record. Chromium
emits none in those cases.

A storefront extension reacts to attribute mutations by rerendering and
reapplying styles. These spurious records keep that cycle running until
the watchdog terminates the page.

Compare the normalized value and priority before rewriting, and treat
removing an absent property as a no-op. Explicit cssText and
setAttribute assignments still notify.

Test mutation counts, priority-only changes, raw attribute preservation,
observer convergence, and healthy batches exceeding 1600 callbacks.
2026-09-16 07:02:54 +08:00
Karl Seguin 7571d6e7a0 Merge pull request #3527 from lightpanda-io/nikneym/stdin-js-exec
`Agent`: add `lightpanda run -`
2026-09-16 06:40:41 +08:00
Karl Seguin f5c1772edb Merge pull request #3516 from lightpanda-io/readonly-computedStyles
webapi: computedStyle are now readonly
2026-09-16 06:38:49 +08:00
Karl Seguin 7910646185 Merge pull request #3532 from lightpanda-io/help-drift
Help drift
2026-09-16 06:38:29 +08:00
Scott Taylor 02a0a33498 Record Linux fatal signals without blocking on stderr
ReleaseFast faults otherwise leave only an exit status. Record the signal,
original fault registers and build identity without entering panic reporting,
the IO backend, an allocator-backed unwinder or telemetry.

For pipe stderr, prepare an independent nonblocking procfs descriptor before
threads start; never change the inherited descriptor's shared flags. For
sockets, use per-call nonblocking send flags. Drop output for unsupported
sinks or backpressure, then re-raise the original signal. Other platforms
retain their existing signal handling.

Core limits still apply, but cores capture the re-raise context rather than
the original fault; document that distinction. Subprocess tests cover full
pipes and sockets with undrained readers, unavailable/read-only/file stderr,
unchanged flags, repeated attachment, held panic locks and hardware faults.
2026-09-15 15:30:11 -04:00
Adrià Arrufat c8873a951c Merge pull request #3528 from lightpanda-io/ci-dispatch-python-release
ci: dispatch the lightpanda-python wheels build instead of creating a release
2026-09-15 21:26:05 +02:00
Pierre Tachoire 9bf65fac5a add missing LLM providers in help 2026-09-15 18:34:24 +02:00
Scott Taylor 39dde6db7c document: keep an aborted parser from restarting after navigation
Track the active-parser-was-aborted flag independently of load state. Navigation can move readyState to complete while the original parser is still on the stack; open/write/close must not start a second parser and trip ScriptManagerBase.staticScriptsDone.

Cover inline navigation, post-parse navigation cancellation, and writes after cancelling an aborted parser. Validated with 1531 passing tests on macOS arm64 and Chromium comparisons for the inline and cancellation cases.

Assisted-By: devx/f397c207-eb48-428c-a6c5-f94d95fd8ae4
2026-09-15 12:23:13 -04:00
Pierre Tachoire c1ddf920ec document --dump pdf in help 2026-09-15 18:13:33 +02:00
Pierre Tachoire 580658676e remove the removed --storage-* from help 2026-09-15 18:11:30 +02:00
Scott Taylor 1a9557e41e frame: stop a superseded document's load events once navigation begins
A script that navigates away during parsing (a locale redirect, say)
left the old document to finish loading normally: DOMContentLoaded and
load fired on it, and clients waiting on those signals were told the
page was ready just as it was being replaced. Chrome fires none of
them: the document still transitions readyState to "complete", but
DOMContentLoaded and load never come.

Mark the document's load aborted when a cross-document navigation is
scheduled (or started directly), and keep it that way through queue
consumption and a discarded or failed replacement. document.open()
cancels the queued navigation, as in Chrome, and the rewritten document
does not get the aborted one's load back.

Tests cover the six trigger points against Chrome's event sequences,
pending and discarded replacements, open()-during-navigation, and a
readystatechange handler that renavigates and throws.
2026-09-15 11:31:09 -04:00