mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 07:31:47 +00:00
dom: implement document.createAttribute
This commit is contained in:
@@ -1192,6 +1192,13 @@ pub inline fn documentAdoptNode(doc: *Document, node: *Node) !*Node {
|
||||
return @as(*Node, @ptrCast(res));
|
||||
}
|
||||
|
||||
pub inline fn documentCreateAttribute(doc: *Document, name: []const u8) !*Attribute {
|
||||
var attr: ?*Attribute = undefined;
|
||||
const err = documentVtable(doc).dom_document_create_attribute.?(doc, try strFromData(name), &attr);
|
||||
try DOMErr(err);
|
||||
return attr.?;
|
||||
}
|
||||
|
||||
// DocumentHTML
|
||||
pub const DocumentHTML = c.dom_html_document;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user