From 755b588387516b2dec94786a91cec06dd8660c52 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 4 Jun 2023 21:08:28 +0200 Subject: [PATCH] [html] Assign document to html_context every time --- src/document/html/internal.h | 2 +- src/document/html/parser.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/document/html/internal.h b/src/document/html/internal.h index 5da8e219..a3311b0a 100644 --- a/src/document/html/internal.h +++ b/src/document/html/internal.h @@ -67,9 +67,9 @@ struct el_sheet { struct html_context { + struct document *document; #ifdef CONFIG_CSS #ifdef CONFIG_LIBCSS - struct document *document; LIST_OF(struct el_sheet) sheets; css_select_ctx *select_ctx; /* The default stylesheet is initially merged into it. When parsing CSS diff --git a/src/document/html/parser.c b/src/document/html/parser.c index 2205424c..2bfc3ad2 100644 --- a/src/document/html/parser.c +++ b/src/document/html/parser.c @@ -822,10 +822,8 @@ init_html_parser(struct uri *uri, struct document *document, html_context = (struct html_context *)mem_calloc(1, sizeof(*html_context)); if (!html_context) return NULL; -#ifdef CONFIG_CSS -#ifdef CONFIG_LIBCSS html_context->document = document; -#endif +#ifdef CONFIG_CSS html_context->css_styles.import = import_css_stylesheet; init_css_selector_set(&html_context->css_styles.selectors); #endif