Commit Graph
9737 Commits
Author SHA1 Message Date
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
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
Adrià Arrufat 03fee916fd Count subtree nodes without recursion
The document extent counts every node in the document, so the recursion
went as deep as the DOM.
2026-09-24 13:40:01 +02:00
Adrià Arrufat 9a0aadd62a Move the document extent onto Document
A document without a frame isn't rendered, so its extent is zero. The
extent cache moves from Frame to Document with it, and the body lookup
reuses HTMLDocument.getBody.
2026-09-24 13:40:01 +02:00
Adrià Arrufat 9dfeef2aef Trim comments 2026-09-24 13:40:01 +02:00
Adrià Arrufat 8fb49fe507 Match Chrome's root scroll size and clamp x too
Only the root scroller's scrollWidth and scrollHeight are floored at the
viewport; html and body keep the document's own height, as in Chrome. The
document's width is body's widest child, and scrollX clamps against it.
2026-09-24 13:40:01 +02:00
Adrià Arrufat f5d9f3e737 Give the document a height and clamp the viewport scroll to it
html and body reported a fixed 100M px height and window.scrollTo never
clamped. The document height is now the tallest of the synthetic node
positions, body's stacked children and the viewport, and the window
can't scroll past its bottom.
2026-09-24 13:40:01 +02:00
Adrià Arrufat 20b0943a21 Trim comments 2026-09-24 13:40:01 +02:00
Adrià Arrufat 822eb1c2f6 Measure wrapped text in an element's content height
A box whose content is only text had no content extent, so its scroll
offset never clamped. With an explicit width, direct text children now
wrap at it and add their lines to the content height.
2026-09-24 13:40:01 +02:00
Adrià Arrufat 20b7325e13 Resolve width and height from stylesheet rules
An element sized by a stylesheet rule had no explicit size, so its scroll
offset never clamped. The geometry group now tracks width and height, and
getElementAxis reads them from the cascade, which already folds in the
inline style. html and body read only their inline size, without
materializing the style object. Removes the now unused
CSS.parseDimensionViewport.
2026-09-24 13:39:55 +02:00
Adrià Arrufat 2ce2fe94df Reset the groups in a loop and trim comments
rebuildIfDirty walks group_fields like the other per-group code, so a new
group needs no change there. Capacities moves out of Group since it
doesn't depend on the spec. Also updates the ownProps and compute call
sites to the (el, frame) order.
2026-09-24 13:39:25 +02:00
Adrià ArrufatandKarl Seguin e547657ab0 Apply batched suggestions from code review
Co-authored-by: Karl Seguin <karlseguin@users.noreply.github.com>
2026-09-24 13:36:45 +02:00
Adrià Arrufat 8d62739503 Split the style cascade into property groups
Each group owns its rule buckets, its memo and its cascade priorities, so a
rule only joins the groups it declares something in. Visibility keeps
display, visibility, opacity and pointer-events; overflow and
overscroll-behavior move to a geometry group. A visibility probe no longer
matches overflow-only rules, and its memo entry shrinks to 6 bits.
2026-09-24 09:24:28 +02:00
Karl Seguin 54b0d114ad Merge pull request #3618 from lightpanda-io/orderfile-regen
orderfile: regenerate the hot-code profile
2026-09-24 09:38:58 +08:00
github-actions[bot] a01a554000 orderfile: regenerate the hot-code profile
hot set 16948KB resident at 4KB fault-around: 21535 text, 21860 rodata symbols
2026-09-24 01:05:29 +00:00
Karl Seguin ff10756ee6 Merge pull request #3607 from lightpanda-io/cleanup-abandoned-document-parsers
mem: Track / Free abandoned html5ever parsers
2026-09-24 06:37:10 +08:00
Karl Seguin 578acc9040 Merge pull request #3587 from lightpanda-io/nikneym/polymer-changes
Changes for `<template>` content
2026-09-24 06:24:14 +08:00
Karl Seguin 6debc4dd71 Merge pull request #3608 from lightpanda-io/webdriver-input
WebDriver: add input (click, clear and sendKeys)
2026-09-24 06:17:35 +08:00
Karl Seguin 4d16a0c4b6 document cleanup after bad parse start 2026-09-24 06:17:00 +08:00
Karl Seguin 5112323b58 Merge pull request #3615 from lightpanda-io/reduce-v8-background-execution-delay
perf: reduce delay in running v8 background jobs
2026-09-24 06:12:41 +08:00
Karl Seguin 2b2bb317dd Merge pull request #3611 from lightpanda-io/inert
webapi: add support for the inert property
2026-09-24 06:12:02 +08:00
Karl Seguin 5cbaf2acb4 Merge pull request #3609 from lightpanda-io/xml-declaration-validation
xml: validate xml declaration
2026-09-24 06:11:44 +08:00
Halil Durak 7690a33c7c update tests 2026-09-23 17:04:16 +03:00
Halil Durak 9454b7d23e CustomElementRegistry: move frame check to upgrade 2026-09-23 17:04:15 +03:00
Halil Durak d4d5fc38eb update tests 2026-09-23 17:04:15 +03:00
Halil Durak 7a4d2fec71 changes for <template> content
Template content belongs to an inert "template contents owner document" with no browsing context, related changes for #3328.
2026-09-23 17:04:15 +03:00
Karl Seguin 1dd33ee7ec Merge pull request #3604 from lightpanda-io/sanitizer
webapi: Start of Sanitizer WebAPI
2026-09-23 21:23:20 +08:00
Karl Seguin d157157721 perf: reduce delay in running v8 background jobs
In Runner, when we're `in_cdp` we reduce the HttpClient poll time to 10ms when
a v8 tells us it has a background task. This is to help ensure we don't linger
too long in HttpClient's poll when v8 has work.

But, 10ms can still be long, especially in a WPT test that's running thousands
of WASM compilation in serial. So rather than having a flat 10ms wait, Runner
will now wait 0-10ms, based on (a) whether the last pump had any tasks and (b)
the number of _ticks since there was task.

This is potentially a temporary solution to having v8 wake the HttpClient when
a task is ready.
2026-09-23 20:02:47 +08:00
Karl Seguin d070a0d34e Merge pull request #3605 from lightpanda-io/x-frame-options
http: add support for x-frame-options
2026-09-23 19:04:08 +08:00
Pierre Tachoire ba5afb8e8c Merge pull request #3610 from lightpanda-io/ci-crgoup
ci: add missing instruction for cgroup install
2026-09-23 12:32:40 +02:00
Karl Seguin d5ba648b7e webapi: add support for the inert property
Improves the /inert/ WPT category
2026-09-23 18:21:31 +08:00
Pierre Tachoire 5e16a9bc54 ci: add missing instruction for cgroup install 2026-09-23 12:12:57 +02:00
Karl Seguin f768a60c3f Merge pull request #3600 from staylor/fix/cdp-context-disposal-events
cdp: notify target closure when disposing browser contexts
2026-09-23 18:03:56 +08:00
Karl Seguin 79376d00fa xml: validate xml declaration
And now, because we do this, we no longer have to have the parser skip anything
that looks like a ProcessingInstruction.
2026-09-23 17:34:10 +08:00
Karl Seguin 1bc6bcc3d1 dedupe close path 2026-09-23 17:08:03 +08:00
Scott Taylor 1296861350 cdp: notify target closure when disposing browser contexts 2026-09-23 16:33:17 +08:00
Karl Seguin 369059e48d WebDriver: add input (click, clear and sendKeys) 2026-09-23 16:19:35 +08:00
Karl Seguin 0016fb0813 mem: Track / Free abandoned html5ever parsers
A parser created via document.open() is only freed when done/close is called
(or some parse error happens). If close() isn't called, the parser is leaked.

This has the Frame track documents that call open so that, on Frame.deinit(),
it can free any parser still associated with the document.
2026-09-23 16:07:03 +08:00
Karl Seguin 414167bfcd Merge pull request #3602 from lightpanda-io/iterative-rendertree
mem: make markdown/screenshot iterative
2026-09-23 15:15:37 +08:00
Karl Seguin 80640f7204 http: add support for x-frame-options
Brings /x-frame-options/ from 43/157 to  157/157.
2026-09-23 12:54:19 +08:00
Karl Seguin 628248a51c webapi: Start of Sanitizer WebAPI
This is the configuration-half of the Sanitizer API. In a follow up, we'll add
the missing element.setHtml and sanitizer option to the existing setHTMLUnsafe
(as well as the ShadowRoot and Document sanitizer-aware methods).
2026-09-23 12:38:43 +08:00
Karl Seguin 31198445dd Merge pull request #3598 from cdebled/cdp-blank-lifecycle
cdp: report the initial about:blank as loaded to lifecycle events
2026-09-23 11:56:18 +08:00
Karl Seguin 3693373041 Merge pull request #3599 from lightpanda-io/log-msg-limit
log: check the message rules at comptime
2026-09-23 11:54:17 +08:00
Karl Seguin f189f077b8 mem: fix my previous bad commits, harden orderfile regen
I'm stealth adding these changes to the log-msg-limit branch/PR because...

This branch reverts a previous intentional change https://github.com/lightpanda-io/browser/pull/2690
which positively impacted memory usage. However #2690 did a couple things, and
changing `comptime msg: []const u8` to `msg: []const u8` was the most
insignificant. So, I was hoping this change would be ok, the real memory gain
of 2690 probably have nothing to do with the comptime message.

BUT, I wanted to make sure, so I re-generated the orderfile on this branch, to
get the CI report for an optimal build. And the memory went +4MB, which seemed
impossible. Turns out my local ../demo was in a weird state from some WebDriver
testing yesterday and nothing was ever executed. So the orderfile I generated
was meaningless.

So, I'm now (a) including optimized orderfiles for this branch and (b) making
regen.sh fail if the bench doesn't seem to successfully run
2026-09-23 11:20:42 +08:00
Karl Seguin 36f2a6cb96 more rebase + regenerate 2026-09-23 11:20:42 +08:00
Karl Seguin 38f354f128 orderfile again 2026-09-23 11:20:42 +08:00
Karl Seguin 71cc6f93e5 fix robots log message length 2026-09-23 11:20:42 +08:00
Karl Seguin 6b1e152a6f update order file
Comptime msg validation was removed in https://github.com/lightpanda-io/browser/pull/2690
as part of a memory reduction effort. But that PR did more than just remove the
comptime msg (and thus the comptime msg check). So I want to see what the memory
usage is with an ideal orderfile.
2026-09-23 11:20:42 +08:00
Adrià Arrufat 728f61a80d log: check the message rules at comptime
logToErased asserts that a log message is at most 30 characters of
plain text, but only in a debug build and only once the line actually
runs. A message on a rare path therefore ships fine and then panics on
whoever first reaches it: `serve --host 0.0.0.0` without
--advertise-host crashed on startup in every debug build, because
"advertising loopback for wildcard bind" is 38 characters.

Every message is a literal, so make the six wrappers take a comptime
msg and apply the same two rules through @compileError. The runtime
check stays as the backstop for the paths the compiler does not
analyse for the current target, and now reads the same constant.

Eleven messages were over the limit; shorten them. The detail already
lives in the kv pairs in each case. renderFailed takes its message as
comptime now, the only call site that passed a runtime one.

Note the check only covers code analysed for the target being built:
the two in Certificates.zig sit in an OS switch prong that Linux never
compiles, and were found by scanning the source rather than by the
compiler.
2026-09-23 11:20:42 +08:00
Karl Seguin b21019cf69 Merge pull request #3603 from lightpanda-io/orderfile-regen
orderfile: regenerate the hot-code profile
2026-09-23 10:44:58 +08:00