Lightpanda: the headless browser designed for AI and automation
remove useless url duplications
Pierre Tachoireb78940d7f664
diff --git a/src/browser/Frame.zig b/src/browser/Frame.zigindex 51f33776c..3b8ad4e31 100644--- a/src/browser/Frame.zig+++ b/src/browser/Frame.zig@@ -1938,8 +1938,10 @@ pub fn queueElementEvent(self: *Frame, element: *Element.Html, kind: QueuedEvent// Per spec, `hashchange` is fired by queuing a task rather than synchronously,// so a listener registered after the fragment change still observes it. The-// captured URLs are duped because the frame's URL keeps changing synchronously-// before the task runs. Mirrors the async-dispatch pattern of MessagePort etc.+// old/new URLs are captured by slice: both already point to arena memory that+// outlives the task, and arena allocations are never freed individually, so a+// synchronous reassignment of the frame's URL before the task runs leaves the+// captured blocks intact. Mirrors the async-dispatch pattern of MessagePort etc.const HashChangeCallback = struct {frame: *Frame,old_url: []const u8,@@ -1974,8 +1976,8 @@ const HashChangeCallback = struct {pub fn queueHashChange(self: *Frame, old_url: []const u8, new_url: []const u8) !void {const callback = try self._factory.create(HashChangeCallback{.frame = self,- .old_url = try self.arena.dupe(u8, old_url),- .new_url = try self.arena.dupe(u8, new_url),+ .old_url = old_url,+ .new_url = new_url,});try self.js.scheduler.add(callback, HashChangeCallback.run, 0, .{.name = "frame.hashChange",