add note about incomplete removal

This commit is contained in:
Karl Seguin
2025-07-17 20:51:05 +08:00
parent bba9c8f652
commit 9c0d26bc84

View File

@@ -510,6 +510,10 @@ pub const Element = struct {
} }
pub fn _remove(self: *parser.Element) !void { pub fn _remove(self: *parser.Element) !void {
// TODO: This hasn't been tested to make sure all references to this
// node are properly updated. A lot of libdom is lazy and will look
// for related elements JIT by walking the tree, but there could be
// cases in libdom or the Zig WebAPI where this reference is kept
const as_node: *parser.Node = @ptrCast(self); const as_node: *parser.Node = @ptrCast(self);
const parent = try parser.nodeParentNode(as_node) orelse return; const parent = try parser.nodeParentNode(as_node) orelse return;
_ = try Node._removeChild(parent, as_node); _ = try Node._removeChild(parent, as_node);