netsurf: move to public only API

And add some Node APIs:
- getters: firstChild, lastChild, nextSibling, previoussibling,
parentNode, parentElement, nodeName, nodeType, ownerDocument,
isConnected
- getters/setters: nodeValue, textContent
- methods: appendChild

And some test comptime optimizations on Document

Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
This commit is contained in:
Francis Bouvier
2023-09-26 11:58:05 +02:00
parent 0bce7a5e37
commit fab03586a3
11 changed files with 536 additions and 137 deletions

View File

@@ -5,7 +5,8 @@ const generate = @import("generate.zig");
const parser = @import("netsurf.zig");
const DOM = @import("dom.zig");
const testExecFn = @import("html/document.zig").testExecFn;
const docTestExecFn = @import("html/document.zig").testExecFn;
const nodeTestExecFn = @import("html/document.zig").testExecFn;
var doc: *parser.DocumentHTML = undefined;
@@ -23,7 +24,8 @@ fn testsExecFn(
try js_env.addObject(apis, doc, "document");
// run tests
try testExecFn(alloc, js_env, apis);
try docTestExecFn(alloc, js_env, apis);
try nodeTestExecFn(alloc, js_env, apis);
}
test {