mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
node: add lookupPrefix method (NOT TESTED)
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
This commit is contained in:
@@ -383,6 +383,21 @@ pub fn nodeIsSameNode(node: *Node, other: *Node) bool {
|
||||
return res;
|
||||
}
|
||||
|
||||
pub fn nodeLookupPrefix(node: *Node, namespace: ?[]const u8) ?[]const u8 {
|
||||
if (namespace == null) {
|
||||
return null;
|
||||
}
|
||||
if (std.mem.eql(u8, namespace.?, "")) {
|
||||
return null;
|
||||
}
|
||||
var s: ?*String = undefined;
|
||||
_ = nodeVtable(node).dom_node_lookup_prefix.?(node, stringFromData(namespace.?), &s);
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
return stringToData(s.?);
|
||||
}
|
||||
|
||||
pub fn nodeNormalize(node: *Node) void {
|
||||
_ = nodeVtable(node).dom_node_normalize.?(node);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user