mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 07:31:47 +00:00
dom: implement document.createProcessingInstruction
This commit is contained in:
@@ -818,6 +818,9 @@ pub fn textSplitText(text: *Text, offset: u32) !*Text {
|
||||
// Comment
|
||||
pub const Comment = c.dom_comment;
|
||||
|
||||
// ProcessingInstruction
|
||||
pub const ProcessingInstruction = c.dom_processing_instruction;
|
||||
|
||||
// Attribute
|
||||
pub const Attribute = c.dom_attr;
|
||||
|
||||
@@ -1161,6 +1164,18 @@ pub inline fn documentCreateComment(doc: *Document, s: []const u8) !*Comment {
|
||||
return com.?;
|
||||
}
|
||||
|
||||
pub inline fn documentCreateProcessingInstruction(doc: *Document, target: []const u8, data: []const u8) !*ProcessingInstruction {
|
||||
var pi: ?*ProcessingInstruction = undefined;
|
||||
const err = documentVtable(doc).dom_document_create_processing_instruction.?(
|
||||
doc,
|
||||
try strFromData(target),
|
||||
try strFromData(data),
|
||||
&pi,
|
||||
);
|
||||
try DOMErr(err);
|
||||
return pi.?;
|
||||
}
|
||||
|
||||
// DocumentHTML
|
||||
pub const DocumentHTML = c.dom_html_document;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user