summaryrefslogtreecommitdiff
path: root/content/handlers/html
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2021-02-20 11:59:38 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2021-02-20 12:00:42 +0000
commit920041a13103b0b207da56d2cb9d16c9ebcaba65 (patch)
tree2b758edf229f661f4247b97311376716fd7d042f /content/handlers/html
parent598629c7369c717f76f52436c27863c073e0e2c8 (diff)
downloadnetsurf-920041a13103b0b207da56d2cb9d16c9ebcaba65.tar.gz
netsurf-920041a13103b0b207da56d2cb9d16c9ebcaba65.tar.bz2
html: layout: Fix to ignore non-element children of lists.
Diffstat (limited to 'content/handlers/html')
-rw-r--r--content/handlers/html/layout.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index 94cdf8fd0..082e537ba 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -4426,15 +4426,22 @@ layout__check_element_type(
const dom_node *node,
dom_html_element_type type)
{
- dom_html_element_type node_type;
+ dom_html_element_type element_type;
+ dom_node_type node_type;
dom_exception exc;
- exc = dom_html_element_get_tag_type(node, &node_type);
+ exc = dom_node_get_node_type(node, &node_type);
+ if (exc != DOM_NO_ERR ||
+ node_type != DOM_ELEMENT_NODE) {
+ return false;
+ }
+
+ exc = dom_html_element_get_tag_type(node, &element_type);
if (exc != DOM_NO_ERR) {
return false;
}
- return node_type == type;
+ return element_type == type;
}