mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
DOM: Add get_dom_node_next()
This commit is contained in:
parent
ea675cbb6e
commit
bc50084475
@ -268,6 +268,24 @@ get_dom_node_prev(struct dom_node *node)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct dom_node *
|
||||
get_dom_node_next(struct dom_node *node)
|
||||
{
|
||||
struct dom_node_list **list;
|
||||
int index;
|
||||
|
||||
assert(node->parent);
|
||||
|
||||
list = get_dom_node_list(node->parent, node);
|
||||
if (!list) return NULL;
|
||||
|
||||
index = get_dom_node_list_pos(*list, node);
|
||||
if (index + 1 < (*list)->size)
|
||||
return (*list)->entries[index + 1];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct dom_node *
|
||||
get_dom_node_child(struct dom_node *parent, enum dom_node_type type,
|
||||
int16_t subtype)
|
||||
|
@ -242,6 +242,9 @@ int get_dom_node_map_index(struct dom_node_list *list, struct dom_node *node);
|
||||
/* Returns the previous sibling to the node. */
|
||||
struct dom_node *get_dom_node_prev(struct dom_node *node);
|
||||
|
||||
/* Returns the next sibling to the node. */
|
||||
struct dom_node *get_dom_node_next(struct dom_node *node);
|
||||
|
||||
/* Returns first text node of the element or NULL. */
|
||||
struct dom_node *
|
||||
get_dom_node_child(struct dom_node *node, enum dom_node_type child_type,
|
||||
|
Loading…
Reference in New Issue
Block a user