Skip to content

Commit 587f527

Browse files
committed
Add get_firstElementChild to DocumentFragment
1 parent 25ed528 commit 587f527

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/.DS_Store

6 KB
Binary file not shown.

src/browser/dom/document_fragment.zig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ pub const DocumentFragment = struct {
8888
const e = try parser.nodeGetElementById(@ptrCast(@alignCast(self)), id) orelse return null;
8989
return try Element.toInterface(e);
9090
}
91+
92+
pub fn get_firstElementChild(self: *parser.DocumentFragment) !?ElementUnion {
93+
var children = try get_children(self);
94+
return try children._item(0);
95+
}
9196
};
9297

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

0 commit comments

Comments
 (0)