From 5fa2a3371c9ed0faded76ffcab77b6b6a93e6101 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Mon, 13 Feb 2023 17:05:48 +0100 Subject: [PATCH] [css] Do not execute css code when CONFIG_LIBCSS was set --- src/document/css/apply.c | 5 +++++ src/document/html/internal.h | 3 +++ src/document/html/parser.c | 9 +++++++++ src/document/html/parser.h | 3 +++ src/document/html/parser/general.c | 3 +++ src/document/html/parser/link.c | 3 +++ src/document/html/parser/parse.c | 12 ++++++++++++ src/document/html/parser/stack.c | 6 ++++++ src/document/meson.build | 2 +- 9 files changed, 45 insertions(+), 1 deletion(-) diff --git a/src/document/css/apply.c b/src/document/css/apply.c index 54390a83..f18ea4dd 100644 --- a/src/document/css/apply.c +++ b/src/document/css/apply.c @@ -234,6 +234,9 @@ examine_element(struct html_context *html_context, struct css_selector *base, process_found_selector(selector, CST_PSEUDO, base); } +#ifdef CONFIG_CSS +#ifdef CONFIG_LIBCSS +#else if (element->attr.class_ && seltype <= CST_CLASS) { const char *class_ = element->attr.class_; @@ -255,6 +258,8 @@ examine_element(struct html_context *html_context, struct css_selector *base, selector = find_css_selector(selectors, CST_ID, rel, element->attr.id, -1); process_found_selector(selector, CST_ID, base); } +#endif +#endif #undef process_found_selector #undef dbginfo diff --git a/src/document/html/internal.h b/src/document/html/internal.h index 676454bc..85d3a2b1 100644 --- a/src/document/html/internal.h +++ b/src/document/html/internal.h @@ -42,10 +42,13 @@ enum html_whitespace_state { struct html_context { #ifdef CONFIG_CSS +#ifdef CONFIG_LIBCSS +#else /* The default stylesheet is initially merged into it. When parsing CSS * from