From 920041a13103b0b207da56d2cb9d16c9ebcaba65 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 20 Feb 2021 11:59:38 +0000 Subject: html: layout: Fix to ignore non-element children of lists. --- content/handlers/html/layout.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'content/handlers/html') 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; } -- cgit v1.2.3