From 6eb90b29208e9e1e32069b05b6d00dbea3ed1dba Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Wed, 13 May 2026 10:36:39 +0800 Subject: [PATCH 1/5] Add window.frameElement --- src/browser/tests/window/window.html | 9 +++++++++ src/browser/webapi/Window.zig | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/src/browser/tests/window/window.html b/src/browser/tests/window/window.html index 22960880..513361ae 100644 --- a/src/browser/tests/window/window.html +++ b/src/browser/tests/window/window.html @@ -403,3 +403,12 @@ testing.onload(() => testing.expectEqual(2, unhandledCalled)); } + + + diff --git a/src/browser/webapi/Window.zig b/src/browser/webapi/Window.zig index 5b4135fc..d602fc1b 100644 --- a/src/browser/webapi/Window.zig +++ b/src/browser/webapi/Window.zig @@ -206,6 +206,10 @@ pub fn getSelection(self: *const Window) *Selection { return &self._document._selection; } +pub fn getFrameElement(self: *const Window) ?*Element.Html.IFrame { + return self._frame.iframe; +} + pub fn getLocation(self: *const Window) *Location { return self._location; } @@ -898,6 +902,7 @@ pub const JsApi = struct { pub const structuredClone = bridge.function(Window.structuredClone, .{}); pub const getComputedStyle = bridge.function(Window.getComputedStyle, .{}); pub const getSelection = bridge.function(Window.getSelection, .{}); + pub const frameElement = bridge.accessor(Window.getFrameElement, null, .{}); pub const frames = bridge.accessor(Window.getWindow, null, .{}); pub const index = bridge.indexed(Window.getFrame, null, .{ .null_as_undefined = true }); From 4a45b4d866f3e511e50472d1ff28c406981a5c13 Mon Sep 17 00:00:00 2001 From: Muki Kiboigo Date: Tue, 12 May 2026 21:50:05 -0700 Subject: [PATCH 2/5] fix crash on robots.txt request fufilled immediately --- src/network/layer/RobotsLayer.zig | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/network/layer/RobotsLayer.zig b/src/network/layer/RobotsLayer.zig index 710884e9..da0d5312 100644 --- a/src/network/layer/RobotsLayer.zig +++ b/src/network/layer/RobotsLayer.zig @@ -96,6 +96,13 @@ fn fetchRobotsThenRequest( errdefer std.debug.assert(self.pending.remove(robots_url)); entry.value_ptr.* = .empty; + try entry.value_ptr.append(self.allocator, transfer); + transfer.loop_owned = true; + errdefer { + entry.value_ptr.deinit(self.allocator); + transfer.loop_owned = false; + } + const robots_ctx = try transfer.arena.create(RobotsContext); robots_ctx.* = .{ .layer = self, @@ -135,14 +142,16 @@ fn fetchRobotsThenRequest( .error_callback = RobotsContext.errorCallback, .shutdown_callback = RobotsContext.shutdownCallback, }, transfer.owner); - } + } else { + // Already one in flight, just queue behind. + try entry.value_ptr.append(self.allocator, transfer); - try entry.value_ptr.append(self.allocator, transfer); - // Parked: RobotsLayer owns destruction via flushPending / flushPendingShutdown - // until robots.txt resolves. Without this, Client.request's errdefer (or - // any caller's cleanup) would deinit a transfer that's still on the - // pending list, leaving flushPending with a dangling pointer. - transfer.loop_owned = true; + // Parked: RobotsLayer owns destruction via flushPending / flushPendingShutdown + // until robots.txt resolves. Without this, Client.request's errdefer (or + // any caller's cleanup) would deinit a transfer that's still on the + // pending list, leaving flushPending with a dangling pointer. + transfer.loop_owned = true; + } } fn flushPending(self: *RobotsLayer, robots_url: [:0]const u8, allowed: bool) void { From cc4ad53661b0c2f325a80a76b7c007c548ba5d6c Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Wed, 13 May 2026 14:38:43 +0800 Subject: [PATCH 3/5] Fix URLSearchParams constructor First, KeyValueList.fromJsObject now only iterates own properties. Second URLSearchParams can now be constructed with another URLSearchParams. This is a stopgap. The correct solution is for it to accept any iterator, but as a quick fix for known cases (airbnb.com), this will help. --- src/browser/js/Object.zig | 2 +- src/browser/tests/net/url_search_params.html | 73 ++++++++++++++++++++ src/browser/webapi/net/URLSearchParams.zig | 9 +++ 3 files changed, 83 insertions(+), 1 deletion(-) diff --git a/src/browser/js/Object.zig b/src/browser/js/Object.zig index fbf036e4..13899782 100644 --- a/src/browser/js/Object.zig +++ b/src/browser/js/Object.zig @@ -152,7 +152,7 @@ pub fn getPropertyNames(self: Object) js.Array { } pub fn nameIterator(self: Object) !NameIterator { - const handle = v8.v8__Object__GetPropertyNames(self.handle, self.local.handle) orelse { + const handle = v8.v8__Object__GetOwnPropertyNames(self.handle, self.local.handle) orelse { // see getOwnPropertyNames above return error.TypeError; }; diff --git a/src/browser/tests/net/url_search_params.html b/src/browser/tests/net/url_search_params.html index a4213655..3ad3c595 100644 --- a/src/browser/tests/net/url_search_params.html +++ b/src/browser/tests/net/url_search_params.html @@ -416,6 +416,79 @@ } + + + + + + + + + + + +