summaryrefslogtreecommitdiff
path: root/css
diff options
context:
space:
mode:
Diffstat (limited to 'css')
-rw-r--r--css/select.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/css/select.c b/css/select.c
index 9dab7e10e..1f65ab0d4 100644
--- a/css/select.c
+++ b/css/select.c
@@ -1292,7 +1292,8 @@ css_error node_is_root(void *pw, void *node, bool *match)
{
xmlNode *n = node;
- *match = (n->parent == NULL);
+ *match = (n->parent == NULL ||
+ n->parent->type == XML_HTML_DOCUMENT_NODE);
return CSS_OK;
}