10120 Commits
Author SHA1 Message Date
Adrià Arrufat c65e174b5a Merge branch 'main' into c-api 2026-10-05 14:22:46 +02:00
Karl Seguin d15600f5be Merge pull request #3704 from lightpanda-io/click-disabled-guard
input: test disabled-button click() suppression, including fieldset inheritance
2026-10-05 18:47:54 +08:00
Karl Seguin 25f259c7f2 Merge pull request #3739 from lightpanda-io/style-cache-followups
Match Chromium's visibility inheritance in styles and the AX tree
2026-10-05 18:47:45 +08:00
Adrià Arrufat 85914a9dc4 input: keep HTMLElement.click's form-control guard so a disabled fieldset still fires
The tag switch already covered fieldset inheritance through isDisabled.
Dropping it suppressed click() on a <fieldset disabled> itself, which
Chrome and Firefox still dispatch.
2026-10-05 12:32:53 +02:00
Adrià Arrufat 2c577f5936 Merge branch 'main' into click-disabled-guard
# Conflicts:
#	src/browser/webapi/WebDriver.zig
2026-10-05 12:31:25 +02:00
Adrià Arrufat cb3e3dc759 StyleManager: drop invalid visibility and pointer-events values
An unrecognized value used to declare the property as visible/auto, which
overrode the inherited value. Now it declares nothing, as the cascade
drops invalid declarations.
2026-10-05 12:28:25 +02:00
Adrià Arrufat 3e2035f84c Merge branch 'main' into style-cache-followups
# Conflicts:
#	src/browser/StyleManager.zig
#	src/server/cdp/AXNode.zig
2026-10-05 12:28:25 +02:00
Karl Seguin 36ff2ba948 Merge pull request #3751 from lightpanda-io/arraybuffer-max-size
mem: limit v8 arraybuffer allocation to 4GB
2026-10-05 13:26:34 +08:00
Karl Seguin 81b994527f Merge pull request #3776 from navidemad/fix-input-value-default-mode
webapi: reflect input.value to the attribute in default modes
2026-10-05 12:52:17 +08:00
Karl Seguin 1108c75be6 mem: limit v8 arraybuffer allocation to 4GB
This was basically unlimited before, but a large number would crash. If someone
thinks 4GB is too small, we could make it an option.

Depends on: https://github.com/lightpanda-io/zig-v8-fork/pull/217
2026-10-05 12:51:35 +08:00
Karl Seguin 9b4c9855d9 Merge pull request #3760 from lightpanda-io/zig-0.17
Upgrade to Zig 0.17
2026-10-05 12:50:05 +08:00
Karl Seguin ab4cc02bdc Merge branch 'main' into zig-0.17 2026-10-05 12:31:55 +08:00
Karl Seguin f4544da758 Fix build
Update zig-v8-fork dependency

Optimize string.repeat

Provide arraybuffer allocation max size (pre-merging https://github.com/lightpanda-io/browser/pull/3751
since the zig-v8-fork now needs it).
2026-10-05 11:33:42 +08:00
Karl Seguin df0d7ab146 track dirty value so that we can properly sanitize on type change 2026-10-05 10:43:08 +08:00
Karl Seguin 3be0331351 Merge pull request #3766 from navidemad/fix-attr-value-stale-after-setattribute
dom: keep materialized Attr values in sync with attribute writes
2026-10-05 10:33:02 +08:00
Karl Seguin cba7989a98 Merge pull request #3761 from jayhemnani9910/fix/selector-type-non-html
selector: match type selectors on XML and foreign elements
2026-10-05 10:07:43 +08:00
Karl Seguin f344758bda Merge pull request #3762 from jayhemnani9910/fix/selector-of-type-custom
selector: tell custom and unknown elements apart in *-of-type
2026-10-05 10:07:06 +08:00
Karl Seguin 56ef1321bf Merge pull request #3738 from lightpanda-io/cdp-navigate-referrer
cdp: honor Page.navigate referrer and referrerPolicy
2026-10-05 10:05:43 +08:00
Karl Seguin 39099c5a17 remove redundant attribute value update 2026-10-05 09:59:05 +08:00
Karl Seguin efa747f2e8 Merge pull request #3778 from Pranav2612000/fix/add-form-field-support
webapi: add support for form.field
2026-10-05 09:50:02 +08:00
Karl Seguin 746292223e zig fmt 2026-10-05 09:37:26 +08:00
Karl Seguin bdc27eccda inline helper 2026-10-05 09:32:53 +08:00
Karl Seguin f163c0c17e Merge pull request #3759 from navidemad/fix-keyboard-input-focused-frame
cdp: route keyboard input to the focused element inside an iframe
2026-10-05 09:24:44 +08:00
Karl Seguin 705645c26c Merge pull request #3779 from lightpanda-io/orderfile-regen
orderfile: regenerate the hot-code profile
2026-10-05 09:17:24 +08:00
github-actions[bot] f9ec98e355 orderfile: regenerate the hot-code profile
hot set 17376KB resident at 4KB fault-around: 21698 text, 22809 rodata symbols
2026-10-05 01:16:16 +00:00
Karl Seguin 07326db23e Don't create (leak) HTMLFormControlsCollection 2026-10-05 09:12:47 +08:00
Karl Seguin 56cb34f184 Don't swallow ExecutionTerminated
Remove recursion so we can have a proper error set.

Fix event ordering (blur on parent before focus on element).
2026-10-05 07:59:35 +08:00
Karl Seguin 525fcd693c Merge pull request #3757 from navidemad/fix-closed-popover-hidden
css: hide a [popover] that is not showing
2026-10-05 07:50:19 +08:00
Karl Seguin 72003ebcd4 Merge pull request #3755 from navidemad/fix-report-callback-exceptions
webapi: report exceptions from timers, animation frames and on* handlers
2026-10-05 07:50:05 +08:00
Karl Seguin a8802bffe1 intern "popover"
Prioritize `dialog:popover-open { display:block; }` check first.
2026-10-05 07:30:21 +08:00
Karl Seguin d0a34421f3 Merge pull request #3750 from staylor/fix/nested-script-checkpoint
script: wait for the inserting script before draining a nested script's tasks
2026-10-05 07:13:16 +08:00
Karl Seguin 6a7be26b6c add guard to protect against recursive error reporting in WGS
Add reportError helperinn Execution and refactor EventManager error reporting
to minimize duplication.
2026-10-05 07:12:08 +08:00
Karl Seguin 68f36cc2c4 Merge pull request #3745 from lightpanda-io/improve-editable-detection
webapi: improve user_input's contenteditable detection
2026-10-04 21:49:17 +08:00
Karl Seguin 25d18c1442 Merge pull request #3746 from lightpanda-io/strip-template
dump: clutter/invisible strip out template
2026-10-04 21:48:48 +08:00
Pranav Joglekar f07b2d3520 webapi: add support for form[field] 2026-10-04 16:07:41 +05:30
Karl Seguin 72625e2497 Merge pull request #3777 from lightpanda-io/null-oomdetail
protect against a null oomdetail
2026-10-04 15:44:50 +08:00
Karl Seguin f6d3c83d07 protect against a null oomdetail 2026-10-04 11:27:05 +08:00
Navid EMAD b2dca654e5 webapi: reflect input.value to the attribute in default modes
Per the HTML spec, the value IDL attribute has four modes. In "default"
(hidden, submit, image, reset, button) and "default/on" (checkbox, radio)
modes, the setter sets the value content attribute and the getter reads
it back (falling back to "" or "on"). Lightpanda only stored the value
internally for every type, so getAttribute("value"), serialization and
[value=...] selectors never saw it.

Changing the type attribute now follows the spec's type change steps:
value -> default writes a non-empty current value to the attribute, and
default -> value restarts from the attribute with the dirty flag cleared.

https://html.spec.whatwg.org/multipage/input.html#dom-input-value
https://html.spec.whatwg.org/multipage/input.html#input-type-change
2026-10-04 05:01:54 +02:00
Navid EMAD 9a67700c81 dom: keep materialized Attr values in sync with attribute writes
An Attr handed out through el.attributes, getNamedItem, getAttributeNode
or an XPath query cached the value it had when it was created: a later
setAttribute updated the element's entry but not the Attr, so attr.value
and el.attributes kept serving the old value while getAttribute returned
the new one. Per the DOM spec an Attr is the attribute itself.

List._put() is the single place an existing entry's value changes, so it
now also updates the Attr cached in page.attribute_lookup, when it is
still attached. The Attr that setAttributeNode replaces is detached
before put() and keeps its old value.
2026-10-04 02:58:15 +02:00
Jay Hemnani ca0df0188b selector: tell custom and unknown elements apart in *-of-type 2026-10-03 23:26:15 +05:30
Jay Hemnani 2e371e7e3a selector: match type selectors on XML and foreign elements 2026-10-03 23:22:15 +05:30
Adrià Arrufat 01a703f7e2 Merge branch 'main' into zig-0.17
# Conflicts:
#	src/browser/StyleManager.zig
2026-10-03 16:12:46 +02:00
Adrià Arrufat c3083725c5 Replace deprecated std.mem.indexOf* with find* 2026-10-03 16:09:42 +02:00
Adrià Arrufat 10609b025a Upgrade to Zig 0.17
Dependencies:
- v8: zig-v8-fork 0.17 branch (lightpanda-io/zig-v8-fork#218).
- sqlite3: build the amalgamation directly; the allyourcodebase wrapper
  has no 0.17 support yet.
- pcre2: master commit with 0.17 support (no release yet).
- translate_c package (2.0.0) replaces the deprecated addTranslateC.
  default_init is set to keep 0.16's zero-initialized struct fields.

Build:
- b.pathFromRoot/build_root/args/sysroot are gone: resolve paths from
  b.root, use addPassthruArgs, declare configure-time file and directory
  dependencies, and poison the configure cache for the git version.
- Drop curl config values the template never used (now an error).
- Drop the 0.16 zip-fetch workaround from the Makefile and CI.
- -Doptimize=ReleaseFast -> -Doptimize=fast.

Language and std:
- @intFromEnum/@enumFromInt -> @backingInt/@fromBackingInt.
- Struct-of-arrays @typeInfo (field_names, field_types, decl_names,
  param_types, error_names).
- `a ** n` removed: @splat for arrays, string.repeat for strings.
- errdefer captures removed: split WebDriver.run and fulfillRedirect.
- @hasDecl only sees pub decls: make StyleManager's Spec.finish pub,
  otherwise it silently stops running.
- SafeAllocator replaces DebugAllocator; the test runner now has to
  initialize std.testing.allocator_instance itself.
- std.fmt.allocPrint/bufPrint -> Allocator.print/std.mem.print,
  dupeZ -> dupeSentinel, std.builtin -> std.lang, builtin.os ->
  builtin.target.os, zon.parse arena API, BufferFirstAllocator, and the
  remaining renames (getLastOrNull, bit_set, ascii.find*, meta.Int).
2026-10-03 16:09:42 +02:00
Navid EMAD 37f81922a8 cdp: route keyboard input to the focused element inside an iframe
Focusing an element inside an iframe only updated that iframe's document,
so the parent's activeElement stayed <body>, and Input.insertText /
Input.dispatchKeyEvent — resolved against the main frame's focused
element — typed nothing. Element.focus now also focuses the containing
<iframe> in its parent frame (the HTML focus chain runs through navigable
containers), and the Input domain sends keys to the focused frame:
user_input.focusedFrame descends while the focused element is an
<iframe> with a loaded document.

Closes #3758
2026-10-03 14:19:55 +02:00
Navid EMAD b18ab9c7a3 css: hide a [popover] that is not showing
The HTML UA stylesheet has
`[popover]:not(:popover-open):not(dialog[open]) { display: none }`, but
matchesUaDisplayNoneRule — the UA display:none fallback shared by
checkVisibility() and getComputedStyle().display — had no popover arm,
so a popover that was never shown, and its whole subtree, read as
rendered. Add the arm next to dialog:not([open]); showing or hiding a
popover already calls frame.domChanged(), which invalidates the memo.

Closes #3756
2026-10-03 14:10:49 +02:00
Navid EMAD 6ba19824b8 webapi: report exceptions from timers, animation frames and on* handlers
Timer, requestAnimationFrame and requestIdleCallback callbacks, inline
on* handlers (attribute or property) and directly dispatched property
handlers such as window.onmessage caught their exceptions and only
counted them, so window's "error" event and onerror never saw them.
Call them inside a TryCatch, the way Listener.run already does, and hand
the exception to the global's reportError (HTML "report an exception").
GlobalScope.reportError routes it to the window or worker global.

Closes #3754
2026-10-03 14:03:55 +02:00
Karl Seguin 6fbbeeec36 Merge pull request #3720 from jayhemnani9910/fix/performance-time-origin
webapi: report performance.timeOrigin relative to the Unix epoch
2026-10-03 16:02:42 +08:00
Jay Hemnani 4fc3b1c6e9 webapi: round timeOrigin like highResTimestamp 2026-10-03 12:09:09 +05:30
Scott Taylor af976c4ed4 script: wait for the inserting script before draining a nested script's tasks
A script inserted by a running script executes synchronously inside that script's call, but the post-execution microtask checkpoint and scheduler run happened regardless of call depth. MutationObserver callbacks, promise reactions and ready timers then ran between the inserting script's statements, once per inserted script. Only drain at an empty JS stack, as the pre-execution checkpoint already does.
2026-10-03 00:33:48 -04:00