summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2019-02-18 00:44:40 +0000
committerJohn-Mark Bell <jmb@netsurf-browser.org>2019-02-18 00:50:08 +0000
commit2ec72552d71e6993dfb43ed6ee956668b5026613 (patch)
tree69c09cd4ba3d103cc23f17302089fd5cc17a5f81
parent843fc213d3f21a8402fcf0358940a8079d8bc927 (diff)
downloadlibcss-2ec72552d71e6993dfb43ed6ee956668b5026613.tar.gz
libcss-2ec72552d71e6993dfb43ed6ee956668b5026613.tar.bz2
Media Queries: fix parsing of media-condition
-rw-r--r--src/parse/mq.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/parse/mq.c b/src/parse/mq.c
index 2b2164f..9d232f9 100644
--- a/src/parse/mq.c
+++ b/src/parse/mq.c
@@ -686,7 +686,7 @@ static css_error mq_parse_condition(lwc_string **strings,
bool permit_or, css_mq_cond **cond)
{
const css_token *token;
- bool match;
+ bool match = false;
int op = 0; /* Will be AND | OR once we've had one */
css_mq_cond_or_feature *cond_or_feature, **parts;
css_mq_cond *result;
@@ -700,11 +700,12 @@ static css_error mq_parse_condition(lwc_string **strings,
*/
token = parserutils_vector_peek(vector, *ctx);
- if (token == NULL || tokenIsChar(token, '(') == false ||
- token->type != CSS_TOKEN_IDENT ||
+ if (token == NULL ||
+ (tokenIsChar(token, '(') == false &&
+ token->type != CSS_TOKEN_IDENT &&
lwc_string_caseless_isequal(token->idata,
- strings[NOT], &match) != lwc_error_ok ||
- match == false) {
+ strings[NOT], &match) != lwc_error_ok &&
+ match == false)) {
return CSS_INVALID;
}