From fa5bda25929f86133618d7ec9e664c6243f94eca Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Mon, 23 May 2022 23:05:36 +0100 Subject: Parse/MQ: unknown media-types do not match Per https://www.w3.org/TR/mediaqueries-4/#error-handling, "An unknown must be treated as not matching" Ensure, however, that a rule with a condition and no type behaves as if type was all. --- src/parse/mq.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/parse/mq.c b/src/parse/mq.c index dde2bbe..b5478a1 100644 --- a/src/parse/mq.c +++ b/src/parse/mq.c @@ -1012,6 +1012,7 @@ static css_error mq_parse_media_query(lwc_string **strings, return error; } + result->type = CSS_MEDIA_ALL; goto finished; } @@ -1066,10 +1067,6 @@ static css_error mq_parse_media_query(lwc_string **strings, } finished: - if (result->type == 0) { - result->type = CSS_MEDIA_ALL; - } - *query = result; return CSS_OK; } -- cgit v1.2.1