mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 07:31:47 +00:00
Add DOMError check in DOMImplementation
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
@@ -889,7 +889,11 @@ pub inline fn documentTypeGetSystemId(dt: *DocumentType) ![]const u8 {
|
||||
}
|
||||
|
||||
// DOMImplementation
|
||||
pub inline fn domImplementationCreateDocument(namespace: ?[:0]const u8, qname: ?[:0]const u8, doctype: ?*DocumentType) *Document {
|
||||
pub inline fn domImplementationCreateDocument(
|
||||
namespace: ?[:0]const u8,
|
||||
qname: ?[:0]const u8,
|
||||
doctype: ?*DocumentType,
|
||||
) !*Document {
|
||||
var doc: ?*Document = undefined;
|
||||
|
||||
var ptrnamespace: [*c]const u8 = null;
|
||||
@@ -902,7 +906,7 @@ pub inline fn domImplementationCreateDocument(namespace: ?[:0]const u8, qname: ?
|
||||
ptrqname = qn.ptr;
|
||||
}
|
||||
|
||||
_ = c.dom_implementation_create_document(
|
||||
const err = c.dom_implementation_create_document(
|
||||
c.DOM_IMPLEMENTATION_XML,
|
||||
ptrnamespace,
|
||||
ptrqname,
|
||||
@@ -911,18 +915,24 @@ pub inline fn domImplementationCreateDocument(namespace: ?[:0]const u8, qname: ?
|
||||
null,
|
||||
&doc,
|
||||
);
|
||||
try DOMErr(err);
|
||||
return doc.?;
|
||||
}
|
||||
|
||||
pub inline fn domImplementationCreateDocumentType(qname: [:0]const u8, publicId: [:0]const u8, systemId: [:0]const u8) *DocumentType {
|
||||
pub inline fn domImplementationCreateDocumentType(
|
||||
qname: [:0]const u8,
|
||||
publicId: [:0]const u8,
|
||||
systemId: [:0]const u8,
|
||||
) !*DocumentType {
|
||||
var dt: ?*DocumentType = undefined;
|
||||
_ = c.dom_implementation_create_document_type(qname.ptr, publicId.ptr, systemId.ptr, &dt);
|
||||
const err = c.dom_implementation_create_document_type(qname.ptr, publicId.ptr, systemId.ptr, &dt);
|
||||
try DOMErr(err);
|
||||
return dt.?;
|
||||
}
|
||||
|
||||
pub inline fn domImplementationCreateHTMLDocument(title: ?[]const u8) *Document {
|
||||
pub inline fn domImplementationCreateHTMLDocument(title: ?[]const u8) !*Document {
|
||||
var doc: ?*Document = undefined;
|
||||
_ = c.dom_implementation_create_document(
|
||||
const err = c.dom_implementation_create_document(
|
||||
c.DOM_IMPLEMENTATION_HTML,
|
||||
null,
|
||||
null,
|
||||
@@ -931,6 +941,7 @@ pub inline fn domImplementationCreateHTMLDocument(title: ?[]const u8) *Document
|
||||
null,
|
||||
&doc,
|
||||
);
|
||||
try DOMErr(err);
|
||||
// TODO set title
|
||||
_ = title;
|
||||
return doc.?;
|
||||
|
||||
Reference in New Issue
Block a user