mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
netsurf: add elementGetAttribute func
This commit is contained in:
@@ -609,6 +609,15 @@ pub fn elementLocalName(elem: *Element) []const u8 {
|
|||||||
return nodeLocalName(node);
|
return nodeLocalName(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn elementGetAttribute(elem: *Element, name: []const u8) ?[]const u8 {
|
||||||
|
var s: ?*String = undefined;
|
||||||
|
_ = elementVtable(elem).dom_element_get_attribute.?(elem, stringFromData(name), &s);
|
||||||
|
if (s == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return stringToData(s.?);
|
||||||
|
}
|
||||||
|
|
||||||
// ElementHTML
|
// ElementHTML
|
||||||
pub const ElementHTML = c.dom_html_element;
|
pub const ElementHTML = c.dom_html_element;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user