From c38be94bf916908ded74ddfc80f5cbe6ed7324df Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 25 Nov 2023 21:37:06 +0000 Subject: css: Fix blocking of presentational hints for author_level_css=0 --- content/handlers/css/hints.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/content/handlers/css/hints.c b/content/handlers/css/hints.c index 286befab9..145cf8185 100644 --- a/content/handlers/css/hints.c +++ b/content/handlers/css/hints.c @@ -1587,10 +1587,6 @@ static void css_hint_list( dom_exception err; dom_string *attr; - if (nsoption_bool(author_level_css) == false) { - return; - } - err = dom_element_get_attribute(node, corestring_dom_type, &attr); if (err == DOM_NO_ERR && attr != NULL) { const char *attr_str = dom_string_data(attr); @@ -1628,13 +1624,19 @@ static void css_hint_list( } -/* Exported function, documeted in css/hints.h */ +/* Exported function, documented in css/hints.h */ css_error node_presentational_hint(void *pw, void *node, uint32_t *nhints, css_hint **hints) { dom_exception exc; dom_html_element_type tag_type; + if (nsoption_bool(author_level_css) == false) { + *nhints = 0; + *hints = NULL; + return CSS_OK; + } + css_hint_clean(); exc = dom_html_element_get_tag_type(node, &tag_type); -- cgit v1.2.3