mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
node: add lookupNamespaceURI method (NOT TESTED)
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
This commit is contained in:
@@ -180,6 +180,11 @@ pub const Node = struct {
|
||||
return parser.nodeLookupPrefix(self, namespace);
|
||||
}
|
||||
|
||||
pub fn _lookupNamespaceURI(self: *parser.Node, prefix: ?[]const u8) ?[]const u8 {
|
||||
// TODO: other is not an optional parameter, but can be null.
|
||||
return parser.nodeLookupNamespaceURI(self, prefix);
|
||||
}
|
||||
|
||||
pub fn _normalize(self: *parser.Node) void {
|
||||
return parser.nodeNormalize(self);
|
||||
}
|
||||
|
||||
@@ -398,6 +398,15 @@ pub fn nodeLookupPrefix(node: *Node, namespace: ?[]const u8) ?[]const u8 {
|
||||
return stringToData(s.?);
|
||||
}
|
||||
|
||||
pub fn nodeLookupNamespaceURI(node: *Node, prefix: ?[]const u8) ?[]const u8 {
|
||||
var s: ?*String = undefined;
|
||||
_ = nodeVtable(node).dom_node_lookup_namespace.?(node, stringFromData(prefix.?), &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