Merge pull request #519 from lightpanda-io/url
Some checks failed
e2e-test / zig build release (push) Has been cancelled
e2e-test / puppeteer-perf (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
wpt / web platform tests (push) Has been cancelled
wpt / web platform tests json output (push) Has been cancelled
wpt / perf-fmt (push) Has been cancelled
zig-test / zig build dev (push) Has been cancelled
zig-test / browser fetch (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

Add URL struct
This commit is contained in:
Pierre Tachoire
2025-04-09 16:43:44 +02:00
committed by GitHub
15 changed files with 283 additions and 242 deletions

View File

@@ -24,6 +24,7 @@ const Testing = @This();
const main = @import("cdp.zig");
const parser = @import("netsurf");
const URL = @import("../url.zig").URL;
const App = @import("../app.zig").App;
const base = @import("../testing.zig");
@@ -89,8 +90,8 @@ const Session = struct {
return error.MockBrowserPageAlreadyExists;
}
self.page = .{
.rawuri = "",
.session = self,
.url = URL.parse("https://lightpanda.io/", null) catch unreachable,
.aux_data = try self.arena.dupe(u8, aux_data orelse ""),
};
return &self.page.?;
@@ -156,7 +157,7 @@ const RemoteObject = struct {
const Page = struct {
session: *Session,
rawuri: []const u8,
url: ?URL = null,
aux_data: []const u8 = "",
doc: ?*parser.Document = null,
@@ -166,10 +167,7 @@ const Page = struct {
}
const MouseEvent = @import("../browser/browser.zig").Page.MouseEvent;
const ClickResult = @import("../browser/browser.zig").Page.ClickResult;
pub fn mouseEvent(_: *Page, _: Allocator, _: MouseEvent) !?ClickResult {
return null;
}
pub fn mouseEvent(_: *Page, _: MouseEvent) !void {}
};
const Client = struct {