Introduce Page (container)

Follow up to https://github.com/lightpanda-io/browser/pull/2200

This change is actually pretty mundane, but a bunch of files that used to
take a *Session (e.g. every WebAPI releaseRef and deinit) now take a *Page.

This aims to separate the 2 lifetimes currently managed by Session by moving
the "Page" lifetime to a dedicated container: Page. Ultimately, the goal is to
remove the 1-page-per-session limit of the current design. Not to explicitly
support multiple pages per session (though, that's more possible now), but
in order to better emulate Chrome where, during a navigation event, the old and
new page both exist.
This commit is contained in:
Karl Seguin
2026-04-22 20:38:50 +08:00
parent 553b32b3b8
commit 550fb58f3f
74 changed files with 819 additions and 664 deletions

View File

@@ -726,7 +726,7 @@ test "SemanticTree backendDOMNodeId" {
var frame = try testing.pageTest("cdp/registry1.html", .{});
defer testing.reset();
defer frame._session.removeFrame();
defer frame._session.removePage();
const st: Self = .{
.dom_node = frame.window._document.asNode(),
@@ -750,7 +750,7 @@ test "SemanticTree max_depth" {
var frame = try testing.pageTest("cdp/registry1.html", .{});
defer testing.reset();
defer frame._session.removeFrame();
defer frame._session.removePage();
const st: Self = .{
.dom_node = frame.window._document.asNode(),