diff --git a/src/server/cdp/Node.zig b/src/server/cdp/Node.zig index fc45ad5fb..eaefba5e8 100644 --- a/src/server/cdp/Node.zig +++ b/src/server/cdp/Node.zig @@ -22,8 +22,10 @@ const std = @import("std"); const lp = @import("lightpanda"); +const id = @import("id.zig"); const Frame = @import("../../browser/Frame.zig"); const DOMNode = @import("../../browser/webapi/Node.zig"); +const IFrame = @import("../../browser/webapi/element/html/IFrame.zig"); const NodeRegistry = @import("../../NodeRegistry.zig"); const log = lp.log; @@ -67,12 +69,12 @@ pub const Search = struct { } pub fn create(self: *List, nodes: []const *DOMNode) !Search { - const id = self.search_id; - defer self.search_id = id +% 1; + const search_id = self.search_id; + defer self.search_id = search_id +% 1; const arena = self.arena.allocator(); - const name = switch (id) { + const name = switch (search_id) { 0 => "0", 1 => "1", 2 => "2", @@ -83,7 +85,7 @@ pub const Search = struct { 7 => "7", 8 => "8", 9 => "9", - else => try std.fmt.allocPrint(arena, "{d}", .{id}), + else => try std.fmt.allocPrint(arena, "{d}", .{search_id}), }; var registry = self.registry; @@ -217,6 +219,25 @@ pub const Writer = struct { try w.objectField("localName"); try w.write(element.getLocalName()); + + // Chrome names the hosted frame on frame-owner elements and the own + // frame on the document element; that's how clients pair an