Merge pull request #624 from lightpanda-io/document_fragment_apis

Add prepend, append and relpaceChildren to DocumentFragment
This commit is contained in:
Pierre Tachoire
2025-05-12 11:31:23 +02:00
committed by GitHub

View File

@@ -43,6 +43,18 @@ pub const DocumentFragment = struct {
_ = self; _ = self;
return true; return true;
} }
pub fn _prepend(self: *parser.DocumentFragment, nodes: []const Node.NodeOrText) !void {
return Node.prepend(parser.documentFragmentToNode(self), nodes);
}
pub fn _append(self: *parser.DocumentFragment, nodes: []const Node.NodeOrText) !void {
return Node.append(parser.documentFragmentToNode(self), nodes);
}
pub fn _replaceChildren(self: *parser.DocumentFragment, nodes: []const Node.NodeOrText) !void {
return Node.replaceChildren(parser.documentFragmentToNode(self), nodes);
}
}; };
const testing = @import("../../testing.zig"); const testing = @import("../../testing.zig");