aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/css/css_rule.cxx
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-06-09 14:41:16 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-06-09 14:41:16 +0100
commit4f0f3b6b1030813ce46846e24313c8639deda4b3 (patch)
tree7d4ed769b151e8d64e4bb7df2c83a92f6d5f482f /src/libserver/css/css_rule.cxx
parent11cca7a60c8a9bc87439a2027619ae90561357c5 (diff)
downloadrspamd-4f0f3b6b1030813ce46846e24313c8639deda4b3.tar.gz
rspamd-4f0f3b6b1030813ce46846e24313c8639deda4b3.zip
[Minor] Process visibility property
Diffstat (limited to 'src/libserver/css/css_rule.cxx')
-rw-r--r--src/libserver/css/css_rule.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/libserver/css/css_rule.cxx b/src/libserver/css/css_rule.cxx
index 238998009..2e84aaa1c 100644
--- a/src/libserver/css/css_rule.cxx
+++ b/src/libserver/css/css_rule.cxx
@@ -180,6 +180,16 @@ allowed_property_value(const css_property &prop, const css_consumed_block &parse
}
}
}
+ if (prop.is_visibility()) {
+ if (parser_block.is_token()) {
+ /* A single token */
+ const auto &tok = parser_block.get_token_or_empty();
+
+ if (tok.type == css_parser_token::token_type::ident_token) {
+ return css_value::maybe_display_from_string(tok.get_string_or_default(""));
+ }
+ }
+ }
if (prop.is_normal_number()) {
if (parser_block.is_token()) {
/* A single token */
@@ -369,10 +379,12 @@ css_declarations_block::merge_block(const css_declarations_block &other, merge_t
}
}
-void css_rule::add_value(const css_value &value) {
+void css_rule::add_value(const css_value &value)
+{
values.push_back(value);
}
+
TEST_SUITE("css rules") {
TEST_CASE("simple css rules") {
const std::vector<std::pair<const char *, std::vector<css_property>>> cases{