From d8b1989e8ee13d4f609475ccdde235b7db5c31ce Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Thu, 16 Nov 2023 16:11:25 +0100 Subject: [PATCH] netsurf: remove useless HTMLCollection wrapper --- src/netsurf.zig | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/src/netsurf.zig b/src/netsurf.zig index aa2ed825..992b8e46 100644 --- a/src/netsurf.zig +++ b/src/netsurf.zig @@ -621,40 +621,6 @@ pub fn elementGetAttribute(elem: *Element, name: []const u8) ?[]const u8 { return stringToData(s.?); } -// HTMLCollection - -pub const HTMLCollection = c.dom_html_collection; - -pub fn HTMLCollectionLength(collection: *HTMLCollection) u32 { - var ln: u32 = undefined; - _ = c.dom_html_collection_get_length(collection, &ln); - return ln; -} - -pub fn HTMLCollectionItem(collection: *HTMLCollection, index: u32) ?*Element { - var n: [*c]c.dom_node = undefined; - _ = c.dom_html_collection_item(collection, index, &n); - - if (n == null) { - return null; - } - - // cast [*c]c.dom_node into *Element - return @as(*Element, @ptrCast(n)); -} - -pub fn HTMLCollectionNamedItem(collection: *HTMLCollection, name: []const u8) ?*Element { - var n: [*c]c.dom_node = undefined; - _ = c.dom_html_collection_named_item(collection, stringFromData(name), &n); - - if (n == null) { - return null; - } - - // cast [*c]c.dom_node into *Element - return @as(*Element, @ptrCast(n)); -} - // ElementHTML pub const ElementHTML = c.dom_html_element;