egrs
25c89c9940
Revert "remove ranges from live list on GC finalization"
...
This reverts commit 625d424199 .
2026-03-11 08:04:53 +01:00
egrs
697a2834c2
Revert "fix CI: store list pointer on AbstractRange to avoid Page type mismatch"
...
This reverts commit 056b8bb536 .
2026-03-11 08:04:51 +01:00
egrs
056b8bb536
fix CI: store list pointer on AbstractRange to avoid Page type mismatch
...
The bridge.finalizer resolves Page through its own module graph, which
can differ from Range.zig's import in release builds. Store a pointer
to the live_ranges list directly on AbstractRange so deinit can remove
without accessing Page fields.
2026-03-11 07:58:31 +01:00
egrs
625d424199
remove ranges from live list on GC finalization
...
Add a weak finalizer to Range that removes its linked list node from
Page._live_ranges when V8 garbage-collects the JS Range object. This
prevents the list from growing unboundedly and avoids iterating over
stale entries during mutation updates.
2026-03-11 07:27:39 +01:00
egrs
d2c55da6c9
address review: move per-range logic to AbstractRange, simplify collapsed check
...
Move the per-range update logic from Page into AbstractRange methods
(updateForCharacterDataReplace, updateForSplitText, updateForNodeInsertion,
updateForNodeRemoval). Page now just iterates the list and delegates.
Remove redundant start_container == end_container check in insertNode —
collapsed already implies same container.
2026-03-11 07:26:20 +01:00
egrs
7927ad8fcf
route appendData through replaceData for spec compliance
...
Per DOM spec, appendData(data) is defined as replaceData(length, 0, data).
While the range update would be a no-op (offset=length, count=0), routing
through replaceData ensures consistent code path and spec compliance.
2026-03-10 20:27:05 +01:00
egrs
d23453ce45
update live ranges after CharacterData and DOM mutations
...
Per DOM spec, all live ranges must have their boundary offsets updated
when CharacterData content changes (insertData, deleteData, replaceData,
splitText) or when nodes are inserted/removed from the tree.
Track live ranges via an intrusive linked list on Page. After each
mutation, iterate and adjust start/end offsets per the spec algorithms.
Also fix Range.deleteContents loop that read _end_offset on each
iteration (now decremented by the range update), and Range.insertNode
that double-incremented _end_offset for non-collapsed ranges.
Route textContent, nodeValue, and data setters through replaceData
so range updates fire consistently.
Fixes 9 WPT test files (all now 100%): Range-mutations-insertData,
deleteData, replaceData, splitText, appendChild, insertBefore,
removeChild, appendData, dataChange (~1330 new passing subtests).
2026-03-10 19:59:04 +01:00
Adrià Arrufat
62f31ea24a
Merge pull request #1765 from egrs/lp-get-structured-data
...
add LP.getStructuredData CDP command
2026-03-10 21:48:18 +09:00
egrs
f4ca5313e6
use std.mem.startsWith, group duplicate property keys into arrays
...
Address review feedback:
- replace custom startsWith helper with std.mem.startsWith
- writeProperties now groups repeated keys (e.g. multiple og:image)
into JSON arrays; single-occurrence keys remain strings
- add test for duplicate key serialization
2026-03-10 13:18:25 +01:00
Karl Seguin
dfd90bd564
Merge pull request #1754 from lightpanda-io/css_value_normalization
...
Apply some normalization to CSS values
2026-03-10 17:36:27 +08:00
Pierre Tachoire
55508eb418
Merge pull request #1763 from lightpanda-io/has_direct_listener
...
Add a hasDirectListeners to EventManager
2026-03-10 10:28:39 +01:00
Pierre Tachoire
2a4fa4ed6f
Merge pull request #1762 from lightpanda-io/xml_get_elements_by_tag_name
...
Node matching using tag name string comparison on non-HTML nodes
2026-03-10 10:27:47 +01:00
Pierre Tachoire
cf7c9f6372
Merge pull request #1760 from lightpanda-io/response_blob
...
Add new Response and Request methods
2026-03-10 10:26:16 +01:00
Pierre Tachoire
ec68c3207d
Merge pull request #1764 from lightpanda-io/js_val_args
...
Better support for variadic js.Value parameter (e.g. console.log)
2026-03-10 10:16:27 +01:00
Pierre Tachoire
ecf140f3d6
Merge pull request #1766 from lightpanda-io/screenshot-size
...
cdp: reszie the screenshot to 1920x1080
2026-03-10 10:15:46 +01:00
Pierre Tachoire
13f73b7b87
Merge pull request #1750 from lightpanda-io/url_set_username_password
...
Add setters to URL.username and URL.password
2026-03-10 10:15:10 +01:00
Pierre Tachoire
12c5bcd24f
cdp: reszie the screenshot to 1920x1080
...
To be consistent w/ layout size returned
2026-03-10 10:09:53 +01:00
egrs
74f0436ac7
merge main, resolve conflicts with getInteractiveElements
2026-03-10 09:25:12 +01:00
egrs
22d31b1527
add LP.getStructuredData CDP command
2026-03-10 09:19:51 +01:00
Karl Seguin
9f3bca771a
Merge pull request #1755 from lightpanda-io/cdp-page-layout-metrics
...
cdp: add a dummy Page.getLayoutMetrics
2026-03-10 16:16:17 +08:00
Adrià Arrufat
4e16d90a81
Merge pull request #1757 from egrs/lp-get-interactive-elements
...
add LP.getInteractiveElements CDP command
2026-03-10 17:15:18 +09:00
Pierre Tachoire
d669d5c153
cdp: add a dummy Page.getLayoutMetrics
2026-03-10 08:54:48 +01:00
Karl Seguin
343d985e96
Better support for variadic js.Value parameter (e.g. console.log)
...
The bridge will prefer to map a Zig array to a JS Array, but in the case of
a []js.Value, it should be willing to map anything into it.
2026-03-10 15:40:18 +08:00
egrs
dc3958356d
address review feedback
...
- TreeWalker.Full instead of FullExcludeSelf so querying a specific
nodeId evaluates the root element itself
- resolve href to absolute URL via URL.resolve
- isDisabled checks ancestor <fieldset disabled> with legend exemption
- parameter order: allocator before *Page per convention
2026-03-10 08:13:01 +01:00
Karl Seguin
c4e85c3277
Add a hasDirectListeners to EventManager
...
Allows checking if a direct listener exists, if it doesn't, event creation can
be skipped.
I looked at a couple sites, the benefits of this is small.
Most sites don't seem to trigger that many direct dispatches and when they do,
they seem to have a listener 50-75% of the time.
2026-03-10 14:57:40 +08:00
Karl Seguin
89e46376dc
Merge pull request #1752 from lightpanda-io/build-zig-fmt-check
...
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
e2e-test / browser fetch (push) Has been cancelled
zig-test / zig test using v8 in debug mode (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
build: add code formatting check
2026-03-10 14:04:28 +08:00
Karl Seguin
8eeb34dba8
Node matching using tag name string comparison on non-HTML nodes
...
NodeLive (used by, e.g. getElementsByTagName) needs to revert to the non-
optimized string-comparison for non-HTML tags.
This should help fix https://github.com/lightpanda-io/browser/issues/1214
2026-03-10 13:42:54 +08:00
Karl Seguin
33d75354a2
Add new Response and Request methods
...
-Response.blob
-Response.clone
-Request.blob
-Request.text
-Request.json
-Request.arrayBuffer
-Request.bytes
-Request.clone
2026-03-10 09:05:06 +08:00
Karl Seguin
0e4a65efb7
Merge pull request #1758 from lightpanda-io/http-auth-challenge
...
http: handle auth challenge for non-proxy auth
2026-03-10 06:39:14 +08:00
Karl Seguin
b88134cf04
Merge pull request #1756 from lightpanda-io/cdp-screenshot
...
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
e2e-test / browser fetch (push) Has been cancelled
zig-test / zig test using v8 in debug mode (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
nightly build / build-linux-x86_64 (push) Has been cancelled
nightly build / build-linux-aarch64 (push) Has been cancelled
nightly build / build-macos-aarch64 (push) Has been cancelled
nightly build / build-macos-x86_64 (push) Has been cancelled
wpt / zig build release (push) Has been cancelled
wpt / build wpt runner (push) Has been cancelled
wpt / web platform tests json output (push) Has been cancelled
wpt / perf-fmt (push) Has been cancelled
e2e-integration-test / zig build release (push) Has been cancelled
e2e-integration-test / demo-integration-scripts (push) Has been cancelled
cdp: add dummy page.captureScreenshot
2026-03-10 06:37:33 +08:00
Karl Seguin
2aaa212dbc
Merge pull request #1753 from lightpanda-io/document_applets
...
document.applets should always return an empty collection
2026-03-10 06:35:23 +08:00
Karl Seguin
1e37990938
Merge pull request #1741 from lightpanda-io/DOMParser_invalid_xml
...
Throw exception, as expected, on empty input to DOMParser.parseFromSt…
2026-03-10 06:32:48 +08:00
egrs
a417c73bf7
add LP.getInteractiveElements CDP command
...
Returns a structured list of all interactive elements on a page:
buttons, links, inputs, ARIA widgets, contenteditable regions, and
elements with event listeners. Includes accessible names, roles,
listener types, and key attributes.
Event listener introspection (both addEventListener and inline
handlers) is unique to LP — no other browser exposes this to
automation code.
2026-03-09 19:46:12 +01:00
Pierre Tachoire
37c34351ee
http: handle auth challenge for non-proxy auth
2026-03-09 19:23:36 +01:00
Pierre Tachoire
8672232ee2
cdp: add dummy page.captureScreenshot
2026-03-09 17:38:57 +01:00
Karl Seguin
3ad10ff8d0
Add support for normalization anchor-size css value
...
vibed this. Seems esoteric, but it helps over 1000 WPT cases pass in
/css/css-anchor-position/anchor-size-parse-valid.html
2026-03-09 18:25:01 +08:00
Karl Seguin
183643547b
document.applets should always return an empty collection
...
Add a new .empty mode to HTMLCollection.
Fixes WPT /shadow-dom/leaktests/html-collection.html
2026-03-09 18:06:22 +08:00
Adrià Arrufat
5568340b9a
build: add code formatting check
2026-03-09 18:48:38 +09:00
Karl Seguin
1399bd3065
Apply some normalization to CSS values
...
"10px 10px" should present as "10px". A length of "0" should present as "0px"
Fixes a handful of WPT tests.
2026-03-09 17:47:59 +08:00
Karl Seguin
9172e16e80
Merge pull request #1751 from lightpanda-io/zig-fmt-face
...
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
e2e-test / browser fetch (push) Has been cancelled
zig-test / zig test using v8 in debug mode (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
zig fmt
2026-03-09 17:34:17 +08:00
Adrià Arrufat
3e5f602396
zig fmt
2026-03-09 18:25:09 +09:00
Karl Seguin
379a3f27b8
Merge pull request #1744 from egrs/add-range-client-rect
...
add Range.getBoundingClientRect and getClientRects
2026-03-09 17:17:17 +08:00
Karl Seguin
ecec932a47
Add setters to URL.username and URL.password
...
Also, preserve port when setting host.
2026-03-09 17:13:12 +08:00
egrs
e239f69f69
delegate Range rect methods to container element
...
Instead of always returning zeros, delegate getBoundingClientRect and
getClientRects to the common ancestor container element. Return zeros
only when the range is collapsed or has no element ancestor.
2026-03-09 10:09:11 +01:00
Karl Seguin
034b089433
Merge pull request #1749 from lightpanda-io/empty_is_and_where_pseudoselector
...
Empty :is() and :where() pseudoselectors are valid (and return nothing)
2026-03-09 16:55:43 +08:00
Karl Seguin
c0db96482c
Merge pull request #1748 from lightpanda-io/font_face_optimization
...
Optimize FontFace
2026-03-09 16:55:28 +08:00
Karl Seguin
ffa8fa0a6f
Merge pull request #1745 from lightpanda-io/renavigate_memory_leak
...
Fix leak introduced in inner navigation refactoring
2026-03-09 16:55:12 +08:00
Karl Seguin
7e1d459a2d
Merge pull request #1746 from egrs/fix-module-relative-imports
...
fix module re-import when previous compilation failed
2026-03-09 16:44:43 +08:00
Karl Seguin
71c4fce87f
Empty :is() and :where() pseudoselectors are valid (and return nothing)
2026-03-09 16:39:44 +08:00
Karl Seguin
e91da78ebb
Optimize FontFace
...
Follow up to https://github.com/lightpanda-io/browser/pull/1743
Allow eager cleanup with finalizer. User properties for (what are currently)
constants.
2026-03-09 16:08:17 +08:00