diff options
-rw-r--r-- | src/parse/properties/utils.c | 6 | ||||
-rw-r--r-- | test/data/parse/colours.dat | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c index 1641353..71296f4 100644 --- a/src/parse/properties/utils.c +++ b/src/parse/properties/utils.c @@ -421,6 +421,12 @@ css_error css__parse_colour_specifier(css_language *c, } if (token->type == CSS_TOKEN_IDENT) { + if ((lwc_string_caseless_isequal( + token->idata, c->strings[TRANSPARENT], + &match) == lwc_error_ok && match)) { + *result = 0; /* black transparent */ + return CSS_OK; + } error = css__parse_named_colour(c, token->idata, result); if (error != CSS_OK && c->sheet->quirks_allowed) { error = css__parse_hash_colour(token->idata, result); diff --git a/test/data/parse/colours.dat b/test/data/parse/colours.dat index dbb5d02..67d5427 100644 --- a/test/data/parse/colours.dat +++ b/test/data/parse/colours.dat @@ -40,6 +40,14 @@ | 0x02000018 0xffff0000 #reset +#data +* { color: transparent } +#errors +#expected +| 1 * +| 0x02000018 0x00000000 +#reset + ## Out-of-range rgb() parameters #data |