Merge pull request #122 from lightpanda-io/dom-processinginstruction-cdata

dom: processing instruction inherits from node
This commit is contained in:
Pierre Tachoire
2023-12-13 10:46:02 +01:00
committed by GitHub

View File

@@ -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 {