From b8cdc0f1455ad5519ff68f0c5f5426294286baa9 Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Mon, 12 May 2025 09:35:33 +0800 Subject: [PATCH] Add prepend, append and relpaceChildren to DocumentFragment --- src/browser/dom/document_fragment.zig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/browser/dom/document_fragment.zig b/src/browser/dom/document_fragment.zig index 03884b1c..e203ee85 100644 --- a/src/browser/dom/document_fragment.zig +++ b/src/browser/dom/document_fragment.zig @@ -43,6 +43,18 @@ pub const DocumentFragment = struct { _ = self; 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");