From 4d5672330b870175763c54bfcef8f5f999d485e6 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Mon, 11 Dec 2023 15:46:33 +0100 Subject: [PATCH] dom: remove processing instruction prototype instead of CDATA. --- src/dom/processing_instruction.zig | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/dom/processing_instruction.zig b/src/dom/processing_instruction.zig index cb5cf29d..2fa24eea 100644 --- a/src/dom/processing_instruction.zig +++ b/src/dom/processing_instruction.zig @@ -2,12 +2,20 @@ const std = @import("std"); const parser = @import("../netsurf.zig"); -const CharacterData = @import("character_data.zig").CharacterData; - // https://dom.spec.whatwg.org/#processinginstruction pub const ProcessingInstruction = struct { pub const Self = parser.ProcessingInstruction; - pub const prototype = *CharacterData; + + // TODO for libdom processing instruction inherit from node. + // But the spec says it must inherit from CDATA. + // Moreover, inherit from Node causes also a crash with cloneNode. + // https://github.com/lightpanda-io/browsercore/issues/123 + // + // In consequence, for now, we don't implement all these func for + // ProcessingInstruction. + // + //pub const prototype = *CharacterData; + pub const mem_guarantied = true; pub fn get_target(self: *parser.ProcessingInstruction) ![]const u8 {