dom: implement document.createDocumentFragment

This commit is contained in:
Pierre Tachoire
2023-12-01 14:43:06 +01:00
parent 555bce9f0b
commit 1bcedead56
7 changed files with 152 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
const std = @import("std");
const parser = @import("../netsurf.zig");
const Node = @import("node.zig").Node;
// WEB IDL https://dom.spec.whatwg.org/#documentfragment
pub const DocumentFragment = struct {
pub const Self = parser.DocumentFragment;
pub const prototype = *Node;
pub const mem_guarantied = true;
// TODO add constructor, but I need to associate the new DocumentFragment
// with the current document global object...
// > The new DocumentFragment() constructor steps are to set thiss node
// > document to current global objects associated Document.
// https://dom.spec.whatwg.org/#dom-documentfragment-documentfragment
pub fn constructor() !*parser.DocumentFragment {
return error.NotImplemented;
}
};