Skip to content

Commit f633edd

Browse files
Merge pull request #624 from lightpanda-io/document_fragment_apis
Add prepend, append and relpaceChildren to DocumentFragment
2 parents b5eea21 + b8cdc0f commit f633edd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/browser/dom/document_fragment.zig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ pub const DocumentFragment = struct {
4343
_ = self;
4444
return true;
4545
}
46+
47+
pub fn _prepend(self: *parser.DocumentFragment, nodes: []const Node.NodeOrText) !void {
48+
return Node.prepend(parser.documentFragmentToNode(self), nodes);
49+
}
50+
51+
pub fn _append(self: *parser.DocumentFragment, nodes: []const Node.NodeOrText) !void {
52+
return Node.append(parser.documentFragmentToNode(self), nodes);
53+
}
54+
55+
pub fn _replaceChildren(self: *parser.DocumentFragment, nodes: []const Node.NodeOrText) !void {
56+
return Node.replaceChildren(parser.documentFragmentToNode(self), nodes);
57+
}
4658
};
4759

4860
const testing = @import("../../testing.zig");

0 commit comments

Comments
 (0)