1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-28 01:35:32 +00:00

The child node list can be NULL when matching for the :empty pseudo-class

Also use the children node list and not the attribute list (aka the map).
This commit is contained in:
Jonas Fonseca 2005-12-23 01:03:39 +01:00 committed by Jonas Fonseca
parent 3ea1b30fd6
commit 8d30613a7f

View File

@ -714,6 +714,8 @@ match_attribute_selectors(struct dom_select_node *base, struct dom_node *node)
static int
match_element_selector(struct dom_select_node *selector, struct dom_node *node)
{
assert(node && node->type == DOM_NODE_ELEMENT);
if (!has_element_match(selector, DOM_SELECT_ELEMENT_UNIVERSAL)
&& dom_node_casecmp(&selector->node, node))
return 0;
@ -748,7 +750,8 @@ match_element_selector(struct dom_select_node *selector, struct dom_node *node)
}
if (has_element_match(selector, DOM_SELECT_ELEMENT_EMPTY)
&& node->data.element.map->size > 0)
&& node->data.element.children
&& node->data.element.children->size > 0)
return 0;
if (has_element_match(selector, DOM_SELECT_ELEMENT_NTH_CHILD)) {