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