mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
node: move arg check in API declaration for nodeLookupPrefix method
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
This commit is contained in:
@@ -178,6 +178,12 @@ pub const Node = struct {
|
|||||||
|
|
||||||
pub fn _lookupPrefix(self: *parser.Node, namespace: ?[]const u8) ?[]const u8 {
|
pub fn _lookupPrefix(self: *parser.Node, namespace: ?[]const u8) ?[]const u8 {
|
||||||
// TODO: other is not an optional parameter, but can be null.
|
// TODO: other is not an optional parameter, but can be null.
|
||||||
|
if (namespace == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (std.mem.eql(u8, namespace.?, "")) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return parser.nodeLookupPrefix(self, namespace);
|
return parser.nodeLookupPrefix(self, namespace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -383,15 +383,9 @@ pub fn nodeIsSameNode(node: *Node, other: *Node) bool {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn nodeLookupPrefix(node: *Node, namespace: ?[]const u8) ?[]const u8 {
|
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;
|
var s: ?*String = undefined;
|
||||||
_ = nodeVtable(node).dom_node_lookup_prefix.?(node, stringFromData(namespace.?), &s);
|
_ = nodeVtable(node).dom_node_lookup_prefix.?(node, stringFromData(namespace), &s);
|
||||||
if (s == null) {
|
if (s == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user