From 4d2826583997794606b07f3577c7a2dedd9d9502 Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Sat, 21 Mar 2026 08:54:33 -0700 Subject: [PATCH] fix: use raw action attribute instead of resolved URL in forms Form.getAction() resolves relative URLs against the page base, which causes test failures when the page URL is a test server address. Use the raw action attribute value instead, which matches what agents need to understand the form's target path. Co-Authored-By: Claude Opus 4.6 --- src/browser/forms.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/browser/forms.zig b/src/browser/forms.zig index 0b2334d3..fd92f722 100644 --- a/src/browser/forms.zig +++ b/src/browser/forms.zig @@ -141,12 +141,12 @@ pub fn collectForms( const fields = try collectFormFields(node, arena, page); if (fields.len == 0) continue; - const action = form_el.getAction(page) catch null; + const action_attr = el.getAttributeSafe(comptime .wrap("action")); const method_str = form_el.getMethod(); try forms.append(arena, .{ .node = node, - .action = if (action) |a| if (a.len > 0) a else null else null, + .action = if (action_attr) |a| if (a.len > 0) a else null else null, .method = if (method_str.len > 0) method_str else null, .fields = fields, });