mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 04:56:50 +03:00
allow for libdom node calls which return NULL to indicate no node.
This commit is contained in:
parent
6d0d964cac
commit
37ea372a10
@ -132,7 +132,9 @@ getter Node::firstChild()
|
|||||||
dom_exception exc;
|
dom_exception exc;
|
||||||
dom_node *n;
|
dom_node *n;
|
||||||
exc = dom_node_get_first_child(priv->node, &n);
|
exc = dom_node_get_first_child(priv->node, &n);
|
||||||
if (exc != DOM_NO_ERR) return 0;
|
if ((exc != DOM_NO_ERR) || (n == NULL)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (dukky_push_node(ctx, n) == false) {
|
if (dukky_push_node(ctx, n) == false) {
|
||||||
dom_node_unref(n);
|
dom_node_unref(n);
|
||||||
return 0;
|
return 0;
|
||||||
@ -146,7 +148,9 @@ getter Node::lastChild()
|
|||||||
dom_exception exc;
|
dom_exception exc;
|
||||||
dom_node *n;
|
dom_node *n;
|
||||||
exc = dom_node_get_last_child(priv->node, &n);
|
exc = dom_node_get_last_child(priv->node, &n);
|
||||||
if (exc != DOM_NO_ERR) return 0;
|
if ((exc != DOM_NO_ERR) || (n == NULL)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (dukky_push_node(ctx, n) == false) {
|
if (dukky_push_node(ctx, n) == false) {
|
||||||
dom_node_unref(n);
|
dom_node_unref(n);
|
||||||
return 0;
|
return 0;
|
||||||
@ -160,7 +164,9 @@ getter Node::previousSibling()
|
|||||||
dom_exception exc;
|
dom_exception exc;
|
||||||
dom_node *n;
|
dom_node *n;
|
||||||
exc = dom_node_get_previous_sibling(priv->node, &n);
|
exc = dom_node_get_previous_sibling(priv->node, &n);
|
||||||
if (exc != DOM_NO_ERR) return 0;
|
if ((exc != DOM_NO_ERR) || (n == NULL)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (dukky_push_node(ctx, n) == false) {
|
if (dukky_push_node(ctx, n) == false) {
|
||||||
dom_node_unref(n);
|
dom_node_unref(n);
|
||||||
return 0;
|
return 0;
|
||||||
@ -174,7 +180,9 @@ getter Node::nextSibling()
|
|||||||
dom_exception exc;
|
dom_exception exc;
|
||||||
dom_node *n;
|
dom_node *n;
|
||||||
exc = dom_node_get_next_sibling(priv->node, &n);
|
exc = dom_node_get_next_sibling(priv->node, &n);
|
||||||
if (exc != DOM_NO_ERR) return 0;
|
if ((exc != DOM_NO_ERR) || (n == NULL)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (dukky_push_node(ctx, n) == false) {
|
if (dukky_push_node(ctx, n) == false) {
|
||||||
dom_node_unref(n);
|
dom_node_unref(n);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user