mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 07:31:47 +00:00
dom: add HTMLCollection
This commit is contained in:
28
src/dom/html_collection.zig
Normal file
28
src/dom/html_collection.zig
Normal file
@@ -0,0 +1,28 @@
|
||||
const std = @import("std");
|
||||
|
||||
const parser = @import("../netsurf.zig");
|
||||
|
||||
const jsruntime = @import("jsruntime");
|
||||
|
||||
const Element = @import("element.zig").Element;
|
||||
|
||||
// WEB IDL https://dom.spec.whatwg.org/#htmlcollection
|
||||
pub const HTMLCollection = struct {
|
||||
pub const Self = parser.HTMLCollection;
|
||||
pub const mem_guarantied = true;
|
||||
|
||||
// JS funcs
|
||||
// --------
|
||||
|
||||
pub fn _get_length(self: *parser.HTMLCollection) u32 {
|
||||
return parser.HTMLCollectionLength(self);
|
||||
}
|
||||
|
||||
pub fn _item(self: *parser.HTMLCollection, index: u32) ?*parser.Element {
|
||||
return parser.HTMLCollectionItem(self, index);
|
||||
}
|
||||
|
||||
pub fn _namedItem(self: *parser.HTMLCollection, name: []const u8) ?*parser.Element {
|
||||
return parser.HTMLCollectionNamedItem(self, name);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user