fix NavigationCurrentEntryChange Constructor

This commit is contained in:
Muki Kiboigo
2025-10-15 07:53:58 -07:00
parent b55b9bba0a
commit 8b4ffeb911
3 changed files with 5 additions and 9 deletions

View File

@@ -38,7 +38,7 @@ pub const Location = struct {
}
pub fn set_href(_: *const Location, href: []const u8, page: *Page) !void {
return page.navigateFromWebAPI(href, .{ .reason = .script });
return page.navigateFromWebAPI(href, .{ .reason = .script }, .{ .push = null });
}
pub fn get_protocol(self: *Location) []const u8 {
@@ -73,10 +73,6 @@ pub const Location = struct {
return self.url.get_origin(page);
}
pub fn set_href(_: *Location, url: []const u8, page: *Page) !void {
return page.navigateFromWebAPI(url, .{ .reason = .script }, .{ .push = null });
}
pub fn _assign(_: *const Location, url: []const u8, page: *Page) !void {
return page.navigateFromWebAPI(url, .{ .reason = .script }, .{ .push = null });
}

View File

@@ -147,7 +147,7 @@ pub const NavigationCurrentEntryChangeEvent = struct {
pub const EventInit = struct {
from: *NavigationHistoryEntry,
navigation_type: ?NavigationType = null,
navigationType: ?NavigationType = null,
};
proto: parser.Event,
@@ -164,7 +164,7 @@ pub const NavigationCurrentEntryChangeEvent = struct {
return .{
.proto = event.*,
.from = opts.from,
.navigation_type = opts.navigation_type,
.navigation_type = opts.navigationType,
};
}
@@ -184,7 +184,7 @@ pub const NavigationCurrentEntryChangeEvent = struct {
var evt = NavigationCurrentEntryChangeEvent.constructor(
"currententrychange",
.{ .from = from, .navigation_type = typ },
.{ .from = from, .navigationType = typ },
) catch |err| {
log.err(.app, "event constructor error", .{
.err = err,

View File

@@ -34,7 +34,7 @@ const Http = @import("../http/Http.zig");
const ScriptManager = @import("ScriptManager.zig");
const SlotChangeMonitor = @import("SlotChangeMonitor.zig");
const HTMLDocument = @import("html/document.zig").HTMLDocument;
const NavigationKind = @import("html/Navigation.zig").NavigationKind;
const NavigationKind = @import("navigation/navigation.zig").NavigationKind;
const js = @import("js/js.zig");
const URL = @import("../url.zig").URL;