Commit Graph

4853 Commits

Author SHA1 Message Date
Adrià Arrufat
55a9976d46 css: CSSStyleSheet.replace() should resolve to the stylesheet 2026-03-14 20:30:00 +09:00
Adrià Arrufat
66a86541d1 css: handle top-level semicolons in parser 2026-03-14 20:30:00 +09:00
Adrià Arrufat
bc19079dad css: add unit tests for RulesIterator 2026-03-14 20:30:00 +09:00
Adrià Arrufat
351e44343d css: make CSSStyleSheet.insertRule index optional 2026-03-14 20:30:00 +09:00
Adrià Arrufat
e362a9cbc3 webapi.Element: use dot notation
Co-authored-by: Karl Seguin <karlseguin@users.noreply.github.com>
2026-03-14 20:29:54 +09:00
Adrià Arrufat
e2563e57f2 webapi.Element: make getCssProperties private
Co-authored-by: Karl Seguin <karlseguin@users.noreply.github.com>
2026-03-14 20:18:51 +09:00
Adrià Arrufat
df5e978247 tests: remove warning
Co-authored-by: Karl Seguin <karlseguin@users.noreply.github.com>
2026-03-14 19:54:43 +09:00
Adrià Arrufat
f37862a25d perf: cache css properties for visibility and interactivity
Introduces `CssCache` to store computed CSS properties, avoiding
redundant stylesheet lookups during DOM traversals.
2026-03-13 14:00:07 +09:00
Adrià Arrufat
84d76cf90d browser: improve visibility and interactivity CSS checks
Adds support for `pointer-events: none` in interactivity classification
and expands `checkVisibility` to include `visibility` and `opacity`.
Refactors CSS property lookup into a shared helper.
2026-03-13 13:33:33 +09:00
Adrià Arrufat
e12f28fb70 Merge branch 'main' into css-improvements 2026-03-13 10:07:06 +09:00
Karl Seguin
d3dad772cf Merge pull request #1806 from lightpanda-io/update_zig_v8_action
Some checks failed
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
update action.yml to latest zig-v8
2026-03-13 07:26:18 +08:00
Karl Seguin
944b672fea Merge pull request #1792 from lightpanda-io/Canvas_getImageData
Add dummy getImageData to canvas
2026-03-13 07:23:05 +08:00
Karl Seguin
b1c54aa92d Merge pull request #1795 from lightpanda-io/navigate_blob_url
Allow navigation from a blob URL.
2026-03-13 07:22:50 +08:00
Karl Seguin
4ca6f43aeb Merge pull request #1803 from lightpanda-io/fix-redirection-cookies
parse cookies on redirection during header callback
2026-03-13 07:17:51 +08:00
Karl Seguin
f09e66e1cc update action.yml to latest zig-v8 2026-03-13 07:15:23 +08:00
Karl Seguin
8b7a4ceaaa Merge pull request #1794 from lightpanda-io/update-docker-zig
update zig-v8 in dockerfile
2026-03-13 07:14:35 +08:00
Pierre Tachoire
51e90f5971 parse cookies on redirection during header callback
THe change to handle bot `\n` and `\r\n` for end HTTP headers skip the
cookie parsing in case of redirection.
2026-03-12 18:42:51 +01:00
Adrià Arrufat
dfe04960c0 css: remove cssText setter from CSSRule and CSSStyleRule 2026-03-12 22:47:41 +09:00
Adrià Arrufat
de2b1cc6fe css: throw IndexSizeError in deleteRule and insertRule 2026-03-12 22:40:01 +09:00
Adrià Arrufat
2aef4ab677 webapi.Element: optimize checkVisibility and refactor loops 2026-03-12 22:32:06 +09:00
Adrià Arrufat
798f68d0ce css: remove curly block helper functions 2026-03-12 22:29:51 +09:00
Adrià Arrufat
e0343a3f6d Replace ArrayListUnmanaged with ArrayList 2026-03-12 22:23:59 +09:00
Adrià Arrufat
d918ec694b css: add log filter to CSSStyleSheet test 2026-03-12 22:21:01 +09:00
Adrià Arrufat
b2b609a309 dom: remove verbose logging and simplify css logic 2026-03-12 22:07:58 +09:00
Adrià Arrufat
48dd80867b dom: support css display: none in checkVisibility
Updates `Element.checkVisibility` to iterate through document
stylesheets and check for matching rules with `display: none`.
Also ensures `<style>` elements register their sheets and
initializes them immediately upon addition to the DOM.
2026-03-12 20:55:44 +09:00
Adrià Arrufat
f58f6e8d65 css: improve CSSOM rule handling and serialization
Refactors `CSSRule` to a union type for better type safety and updates
`CSSStyleRule` to use `CSSStyleProperties`. Adds comprehensive tests for
`insertRule`, `deleteRule`, and `replaceSync`.
2026-03-12 20:23:59 +09:00
Karl Seguin
e4e21f52b5 Allow navigation from a blob URL.
These are used a lot in WPT test.
2026-03-12 18:58:10 +08:00
Pierre Tachoire
84e1cd08b6 update zig-v8 in dockerfile 2026-03-12 11:54:06 +01:00
Pierre Tachoire
7796753e7a Merge pull request #1791 from lightpanda-io/wp/mrdimidium/update-v8
Some checks failed
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
Update zig-v8
2026-03-12 11:48:27 +01:00
Karl Seguin
880205e874 Add dummy getImageData to canvas
Probably doesn't solve many (if any) WPT tests, but it moves them further along.
2026-03-12 17:53:00 +08:00
Nikolay Govorov
1b96087b08 Update zig-v8 2026-03-12 08:50:33 +00:00
Karl Seguin
aa246c9e9f Merge pull request #1788 from lightpanda-io/range_cleanup
Add cleanup to Range
2026-03-12 16:45:05 +08:00
Adrià Arrufat
ee034943b6 feat(css): implement stylesheet rule management
Adds a CSS rule parser and implements `insertRule`, `deleteRule`, and
`replaceSync` in `CSSStyleSheet`. Also updates `CSSRuleList` to use
dynamic storage and populates sheets from `<style>` elements.
2026-03-12 16:27:25 +09:00
Karl Seguin
f1d311d232 Merge pull request #1781 from lightpanda-io/wp/mrdimidium/telemetry-network
Some checks failed
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
Use global connections poll
2026-03-12 13:46:51 +08:00
Karl Seguin
e4f7fca10d Merge pull request #1789 from lightpanda-io/fix-test-warnings
testing: add LogFilter utility for scoped log suppression
2026-03-12 13:40:13 +08:00
Adrià Arrufat
3d6d669a50 testing: add LogFilter utility for scoped log suppression 2026-03-12 13:56:53 +09:00
Nikolay Govorov
c4097e2b7e remove dead-code 2026-03-12 03:55:48 +00:00
Karl Seguin
619d27c773 Add cleanup to Range
In https://github.com/lightpanda-io/browser/pull/1774 we started to track Ranges
in the page in order to correctly make them "live". But, without correct
lifetime, they would continue to be "live" even if out of scope in JS.

This commit adds finalizers to Range via reference counting similar to Events.
It _is_ possible for a Range to outlive its page, so we can't just remove the
range from the Page's _live_range list - the page might not be valid. This
commit gives every page an unique id and the ability to try and get the page
by id from the session. By capturing the page_id at creation-time, a Range
can defensively remove itself from the page's list. If the page is already
gone, then there's no need to do anything.
2026-03-12 10:38:07 +08:00
Karl Seguin
1522c90294 Merge pull request #1787 from lightpanda-io/dummy-filelist
Some checks failed
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
Add FileList Web API stub
2026-03-12 06:37:00 +08:00
Karl Seguin
794e15ce21 Merge pull request #1786 from lightpanda-io/fontfaceset-load
FontFaceSet is now an EventTarget
2026-03-12 06:36:22 +08:00
Karl Seguin
34771b835e Merge pull request #1783 from lightpanda-io/custom_element_dynamic_markup_handling
Throw on dynamic markup in custom element callbacks during parsing
2026-03-12 06:27:22 +08:00
Karl Seguin
8df51b232a Merge pull request #1784 from lightpanda-io/origin_arena
Use origin.arena for values that are tied to the origin
2026-03-12 06:26:20 +08:00
Karl Seguin
13b8ce18b2 Merge pull request #1780 from lightpanda-io/anchor_and_form_target
Add support for target attribute on anchors and forms
2026-03-12 06:26:08 +08:00
Pierre Tachoire
448386e52b Add FileList Web API stub
Next.js hydration references FileList as a global for feature detection.
Register a minimal stub (length=0, item()→null) so the type exists in
the global scope and the reference check doesn't throw.
2026-03-11 22:31:12 +01:00
Pierre Tachoire
bf07659dd5 FontFaceSet is now an EventTarget
Dispatch loading and loaddone events on load() call
2026-03-11 22:18:42 +01:00
Karl Seguin
16dfad0895 Use origin.arena for values that are tied to the origin
Of note, the TAO and identity map entry has to use the origin arena, not
the context arena, as those can outlive the context.
2026-03-11 21:55:58 +08:00
Adrià Arrufat
f61449c31c Merge pull request #1776 from lightpanda-io/semantic-tree
Some checks failed
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
Add native Semantic Tree extraction engine for AI agents
2026-03-11 21:01:04 +09:00
Adrià Arrufat
60699229ca Merge branch 'main' into semantic-tree 2026-03-11 20:52:39 +09:00
Karl Seguin
e1dd26b307 Throw on dynamic markup in custom element callbacks during parsing
Custom element callbacks aren't allowed to call document.open/close/write while
parsing.

Fixes WPT crash:
/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html
2026-03-11 18:41:06 +08:00
Pierre Tachoire
7d835ef99d Merge pull request #1778 from lightpanda-io/wp/mrdimidium/libcurl-malloc
Use zig allocator for libcurl
2026-03-11 10:13:13 +01:00