From 80cfe125983eb126a9f8afd974196cf0bf347877 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 27 Mar 2010 16:10:57 +0000 Subject: Fix libcss to use new libwapcaplet behaviour. TODO: update the tests to include a refcounting proof svn path=/trunk/libcss/; revision=10162 --- src/parse/important.c | 3 +- src/parse/language.c | 107 +++++-------- src/parse/parse.c | 25 +-- src/parse/parse.h | 4 +- src/parse/properties/aural.c | 262 +++++++++++--------------------- src/parse/properties/background.c | 59 +++---- src/parse/properties/border_outline.c | 99 ++++-------- src/parse/properties/display_sizing.c | 87 ++++------- src/parse/properties/effects_stacking.c | 45 ++---- src/parse/properties/font.c | 117 +++++--------- src/parse/properties/generated_list.c | 151 +++++++----------- src/parse/properties/margin.c | 12 +- src/parse/properties/padding.c | 9 +- src/parse/properties/page.c | 51 +++---- src/parse/properties/positioning.c | 75 +++------ src/parse/properties/table.c | 27 ++-- src/parse/properties/text.c | 114 +++++--------- src/parse/properties/ui.c | 110 +++++--------- src/parse/properties/utils.c | 20 +-- 19 files changed, 465 insertions(+), 912 deletions(-) (limited to 'src/parse') diff --git a/src/parse/important.c b/src/parse/important.c index 07ff1f6..5790122 100644 --- a/src/parse/important.c +++ b/src/parse/important.c @@ -44,8 +44,7 @@ css_error parse_important(css_language *c, return CSS_INVALID; } - if (lwc_context_string_caseless_isequal(c->sheet->dictionary, - token->idata, c->strings[IMPORTANT], + if (lwc_string_caseless_isequal(token->idata, c->strings[IMPORTANT], &match) == lwc_error_ok && match) { *result |= FLAG_IMPORTANT; } else { diff --git a/src/parse/language.c b/src/parse/language.c index fff0eff..ee18463 100644 --- a/src/parse/language.c +++ b/src/parse/language.c @@ -129,8 +129,7 @@ css_error css_language_create(css_stylesheet *sheet, css_parser *parser, /* Intern all known strings */ for (i = 0; i < LAST_KNOWN; i++) { - lerror = lwc_context_intern(sheet->dictionary, - stringmap[i].data, + lerror = lwc_intern_string(stringmap[i].data, stringmap[i].len, &(c->strings[i])); if (lerror != lwc_error_ok) { @@ -175,8 +174,7 @@ css_error css_language_destroy(css_language *language) parserutils_stack_destroy(language->context); for (i = 0; i < LAST_KNOWN; ++i) { - lwc_context_string_unref(language->sheet->dictionary, - language->strings[i]); + lwc_string_unref(language->strings[i]); } language->alloc(language, 0, language->pw); @@ -364,8 +362,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector) * there is one */ assert(atkeyword != NULL && atkeyword->type == CSS_TOKEN_ATKEYWORD); - if (lwc_context_string_caseless_isequal(c->sheet->dictionary, - atkeyword->idata, c->strings[CHARSET], + if (lwc_string_caseless_isequal(atkeyword->idata, c->strings[CHARSET], &match) == lwc_error_ok && match) { if (c->state == BEFORE_CHARSET) { const css_token *charset; @@ -408,8 +405,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector) } else { return CSS_INVALID; } - } else if (lwc_context_string_caseless_isequal(c->sheet->dictionary, - atkeyword->idata, c->strings[IMPORT], + } else if (lwc_string_caseless_isequal(atkeyword->idata, c->strings[IMPORT], &match) == lwc_error_ok && match) { if (c->state != HAD_RULE) { lwc_string *url; @@ -438,7 +434,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector) /* Resolve import URI */ error = c->sheet->resolve(c->sheet->resolve_pw, - c->sheet->dictionary, c->sheet->url, + c->sheet->url, uri->idata, &url); if (error != CSS_OK) { css_stylesheet_rule_destroy(c->sheet, rule); @@ -449,14 +445,13 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector) error = css_stylesheet_rule_set_nascent_import(c->sheet, rule, url, media); if (error != CSS_OK) { - lwc_context_string_unref(c->sheet->dictionary, - url); + lwc_string_unref(url); css_stylesheet_rule_destroy(c->sheet, rule); return error; } /* No longer care about url */ - lwc_context_string_unref(c->sheet->dictionary, url); + lwc_string_unref(url); /* Add rule to sheet */ error = css_stylesheet_add_rule(c->sheet, rule, NULL); @@ -472,8 +467,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector) } else { return CSS_INVALID; } - } else if (lwc_context_string_caseless_isequal(c->sheet->dictionary, - atkeyword->idata, c->strings[MEDIA], + } else if (lwc_string_caseless_isequal(atkeyword->idata, c->strings[MEDIA], &match) == lwc_error_ok && match) { uint64_t media = 0; @@ -504,8 +498,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector) * so no need to destroy it */ c->state = HAD_RULE; - } else if (lwc_context_string_caseless_isequal(c->sheet->dictionary, - atkeyword->idata, c->strings[PAGE], + } else if (lwc_string_caseless_isequal(atkeyword->idata, c->strings[PAGE], &match) == lwc_error_ok && match) { const css_token *token; @@ -730,57 +723,46 @@ css_error parseMediaList(css_language *c, if (token->type != CSS_TOKEN_IDENT) return CSS_INVALID; - if (lwc_context_string_caseless_isequal(c->sheet->dictionary, - token->idata, c->strings[AURAL], + if (lwc_string_caseless_isequal(token->idata, c->strings[AURAL], &match) == lwc_error_ok && match) { ret |= CSS_MEDIA_AURAL; - } else if (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if (lwc_string_caseless_isequal( token->idata, c->strings[BRAILLE], &match) == lwc_error_ok && match) { ret |= CSS_MEDIA_BRAILLE; - } else if (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if (lwc_string_caseless_isequal( token->idata, c->strings[EMBOSSED], &match) == lwc_error_ok && match) { ret |= CSS_MEDIA_EMBOSSED; - } else if (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if (lwc_string_caseless_isequal( token->idata, c->strings[HANDHELD], &match) == lwc_error_ok && match) { ret |= CSS_MEDIA_HANDHELD; - } else if (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if (lwc_string_caseless_isequal( token->idata, c->strings[PRINT], &match) == lwc_error_ok && match) { ret |= CSS_MEDIA_PRINT; - } else if (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if (lwc_string_caseless_isequal( token->idata, c->strings[PROJECTION], &match) == lwc_error_ok && match) { ret |= CSS_MEDIA_PROJECTION; - } else if (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if (lwc_string_caseless_isequal( token->idata, c->strings[SCREEN], &match) == lwc_error_ok && match) { ret |= CSS_MEDIA_SCREEN; - } else if (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if (lwc_string_caseless_isequal( token->idata, c->strings[SPEECH], &match) == lwc_error_ok && match) { ret |= CSS_MEDIA_SPEECH; - } else if (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if (lwc_string_caseless_isequal( token->idata, c->strings[TTY], &match) == lwc_error_ok && match) { ret |= CSS_MEDIA_TTY; - } else if (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if (lwc_string_caseless_isequal( token->idata, c->strings[TV], &match) == lwc_error_ok && match) { ret |= CSS_MEDIA_TV; - } else if (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if (lwc_string_caseless_isequal( token->idata, c->strings[ALL], &match) == lwc_error_ok && match) { ret |= CSS_MEDIA_ALL; @@ -924,59 +906,47 @@ css_error parsePseudo(css_language *c, const parserutils_vector *vector, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal(c->sheet->dictionary, - name->idata, c->strings[FIRST_CHILD], - &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( + name->idata, c->strings[FIRST_CHILD], + &match) == lwc_error_ok && match) || + (lwc_string_caseless_isequal( name->idata, c->strings[LINK], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( name->idata, c->strings[VISITED], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( name->idata, c->strings[HOVER], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( name->idata, c->strings[ACTIVE], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( name->idata, c->strings[FOCUS], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( name->idata, c->strings[LANG], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( name->idata, c->strings[LEFT], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( name->idata, c->strings[RIGHT], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( name->idata, c->strings[FIRST], &match) == lwc_error_ok && match)) type = CSS_SELECTOR_PSEUDO_CLASS; - else if ((lwc_context_string_caseless_isequal(c->sheet->dictionary, - name->idata, c->strings[FIRST_LINE], + else if ((lwc_string_caseless_isequal( + name->idata, c->strings[FIRST_LINE], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( name->idata, c->strings[FIRST_LETTER], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( name->idata, c->strings[BEFORE], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( name->idata, c->strings[AFTER], &match) == lwc_error_ok && match)) type = CSS_SELECTOR_PSEUDO_ELEMENT; @@ -1277,8 +1247,7 @@ css_error parseProperty(css_language *c, const css_token *property, for (i = FIRST_PROP; i <= LAST_PROP; i++) { bool match = false; - if (lwc_context_string_caseless_isequal(c->sheet->dictionary, - property->idata, c->strings[i], + if (lwc_string_caseless_isequal(property->idata, c->strings[i], &match) == lwc_error_ok && match) break; } diff --git a/src/parse/parse.c b/src/parse/parse.c index dc5ede1..d52a6c4 100644 --- a/src/parse/parse.c +++ b/src/parse/parse.c @@ -95,8 +95,6 @@ struct css_parser #define STACK_CHUNK 32 parserutils_stack *states; /**< Stack of states */ - lwc_context *dictionary; /**< Dictionary for interned strings */ - parserutils_vector *tokens; /**< Vector of pending tokens */ const css_token *pushback; /**< Push back buffer */ @@ -116,7 +114,7 @@ struct css_parser }; static css_error css_parser_create_internal(const char *charset, - css_charset_source cs_source, lwc_context *dictionary, + css_charset_source cs_source, css_allocator_fn alloc, void *pw, parser_state initial, css_parser **parser); @@ -195,7 +193,6 @@ static css_error (*parseFuncs[])(css_parser *parser) = { * * \param charset Charset of data, if known, or NULL * \param cs_source Source of charset information, or CSS_CHARSET_DEFAULT - * \param dictionary Dictionary in which to intern strings (not copied) * \param alloc Memory (de)allocation function * \param pw Pointer to client-specific private data * \param parser Pointer to location to receive parser instance @@ -204,12 +201,12 @@ static css_error (*parseFuncs[])(css_parser *parser) = { * CSS_NOMEM on memory exhaustion */ css_error css_parser_create(const char *charset, css_charset_source cs_source, - lwc_context *dictionary, css_allocator_fn alloc, void *pw, + css_allocator_fn alloc, void *pw, css_parser **parser) { parser_state initial = { sStart, 0 }; - return css_parser_create_internal(charset, cs_source, dictionary, + return css_parser_create_internal(charset, cs_source, alloc, pw, initial, parser); } @@ -218,7 +215,6 @@ css_error css_parser_create(const char *charset, css_charset_source cs_source, * * \param charset Charset of data, if known, or NULL * \param cs_source Source of charset information, or CSS_CHARSET_DEFAULT - * \param dictionary Dictionary in which to intern strings (not copied) * \param alloc Memory (de)allocation function * \param pw Pointer to client-specific private data * \param parser Pointer to location to receive parser instance @@ -227,12 +223,12 @@ css_error css_parser_create(const char *charset, css_charset_source cs_source, * CSS_NOMEM on memory exhaustion */ css_error css_parser_create_for_inline_style(const char *charset, - css_charset_source cs_source, lwc_context *dictionary, + css_charset_source cs_source, css_allocator_fn alloc, void *pw, css_parser **parser) { parser_state initial = { sInlineStyle, 0 }; - return css_parser_create_internal(charset, cs_source, dictionary, + return css_parser_create_internal(charset, cs_source, alloc, pw, initial, parser); } @@ -397,7 +393,6 @@ bool css_parser_quirks_permitted(css_parser *parser) * * \param charset Charset of data, if known, or NULL * \param cs_source Source of charset information, or CSS_CHARSET_DEFAULT - * \param dictionary Dictionary in which to intern strings (not copied) * \param alloc Memory (de)allocation function * \param pw Pointer to client-specific private data * \param initial The required initial state of the parser @@ -407,7 +402,7 @@ bool css_parser_quirks_permitted(css_parser *parser) * CSS_NOMEM on memory exhaustion */ css_error css_parser_create_internal(const char *charset, - css_charset_source cs_source, lwc_context *dictionary, + css_charset_source cs_source, css_allocator_fn alloc, void *pw, parser_state initial, css_parser **parser) { @@ -447,8 +442,6 @@ css_error css_parser_create_internal(const char *charset, return css_error_from_parserutils_error(perror); } - p->dictionary = dictionary; - perror = parserutils_vector_create(sizeof(css_token), STACK_CHUNK, (parserutils_alloc) alloc, pw, &p->tokens); @@ -655,8 +648,7 @@ css_error getToken(css_parser *parser, const css_token **token) if (t->type < CSS_TOKEN_LAST_INTERN && t->data.data != NULL) { /* Insert token text into the dictionary */ - lerror = lwc_context_intern(parser->dictionary, - (char *)t->data.data, + lerror = lwc_intern_string((char *)t->data.data, t->data.len, &t->idata); if (lerror != lwc_error_ok) return css_error_from_lwc_error(lerror); @@ -2612,8 +2604,7 @@ void unref_interned_strings_in_tokens(css_parser *parser) while ((tok = parserutils_vector_iterate( parser->tokens, &ctx)) != NULL) { if (tok->idata != NULL) { - lwc_context_string_unref(parser->dictionary, - tok->idata); + lwc_string_unref(tok->idata); } } } diff --git a/src/parse/parse.h b/src/parse/parse.h index 269ce29..a2ffa35 100644 --- a/src/parse/parse.h +++ b/src/parse/parse.h @@ -58,10 +58,10 @@ typedef union css_parser_optparams { } css_parser_optparams; css_error css_parser_create(const char *charset, css_charset_source cs_source, - lwc_context *dict, css_allocator_fn alloc, void *pw, + css_allocator_fn alloc, void *pw, css_parser **parser); css_error css_parser_create_for_inline_style(const char *charset, - css_charset_source cs_source, lwc_context *dict, + css_charset_source cs_source, css_allocator_fn alloc, void *pw, css_parser **parser); css_error css_parser_destroy(css_parser *parser); diff --git a/src/parse/properties/aural.c b/src/parse/properties/aural.c index 9367e93..0bc59ee 100644 --- a/src/parse/properties/aural.c +++ b/src/parse/properties/aural.c @@ -62,20 +62,17 @@ css_error parse_azimuth(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal(c->sheet->dictionary, - token->idata, c->strings[INHERIT], + (lwc_string_caseless_isequal(token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal(c->sheet->dictionary, - token->idata, c->strings[LEFTWARDS], + (lwc_string_caseless_isequal(token->idata, c->strings[LEFTWARDS], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = AZIMUTH_LEFTWARDS; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal(c->sheet->dictionary, - token->idata, c->strings[RIGHTWARDS], + (lwc_string_caseless_isequal(token->idata, c->strings[RIGHTWARDS], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = AZIMUTH_RIGHTWARDS; @@ -85,53 +82,43 @@ css_error parse_azimuth(css_language *c, /* Now, we may have one of the other keywords or behind, * potentially followed by behind or other keyword, * respectively */ - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[LEFT_SIDE], &match) == lwc_error_ok && match)) { value = AZIMUTH_LEFT_SIDE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[FAR_LEFT], &match) == lwc_error_ok && match)) { value = AZIMUTH_FAR_LEFT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[LEFT], &match) == lwc_error_ok && match)) { value = AZIMUTH_LEFT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[CENTER_LEFT], &match) == lwc_error_ok && match)) { value = AZIMUTH_CENTER_LEFT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[CENTER], &match) == lwc_error_ok && match)) { value = AZIMUTH_CENTER; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[CENTER_RIGHT], &match) == lwc_error_ok && match)) { value = AZIMUTH_CENTER_RIGHT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[RIGHT], &match) == lwc_error_ok && match)) { value = AZIMUTH_RIGHT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[FAR_RIGHT], &match) == lwc_error_ok && match)) { value = AZIMUTH_FAR_RIGHT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[RIGHT_SIDE], &match) == lwc_error_ok && match)) { value = AZIMUTH_RIGHT_SIDE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[BEHIND], &match) == lwc_error_ok && match)) { value = AZIMUTH_BEHIND; @@ -149,48 +136,39 @@ css_error parse_azimuth(css_language *c, value == AZIMUTH_BEHIND) { parserutils_vector_iterate(vector, ctx); - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[LEFT_SIDE], &match) == lwc_error_ok && match)) { value |= AZIMUTH_LEFT_SIDE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[FAR_LEFT], &match) == lwc_error_ok && match)) { value |= AZIMUTH_FAR_LEFT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[LEFT], &match) == lwc_error_ok && match)) { value |= AZIMUTH_LEFT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[CENTER_LEFT], &match) == lwc_error_ok && match)) { value |= AZIMUTH_CENTER_LEFT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[CENTER], &match) == lwc_error_ok && match)) { value |= AZIMUTH_CENTER; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[CENTER_RIGHT], &match) == lwc_error_ok && match)) { value |= AZIMUTH_CENTER_RIGHT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[RIGHT], &match) == lwc_error_ok && match)) { value |= AZIMUTH_RIGHT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[FAR_RIGHT], &match) == lwc_error_ok && match)) { value |= AZIMUTH_FAR_RIGHT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[RIGHT_SIDE], &match) == lwc_error_ok && match)) { value |= AZIMUTH_RIGHT_SIDE; @@ -202,8 +180,7 @@ css_error parse_azimuth(css_language *c, value != AZIMUTH_BEHIND) { parserutils_vector_iterate(vector, ctx); - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[BEHIND], &match) == lwc_error_ok && match)) { value |= AZIMUTH_BEHIND; @@ -306,8 +283,7 @@ css_error parse_cue(css_language *c, /* Deal with inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { uint32_t *bytecode; @@ -343,8 +319,7 @@ css_error parse_cue(css_language *c, /* Ensure that we're not about to parse another inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { error = CSS_INVALID; @@ -510,43 +485,37 @@ css_error parse_elevation(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[BELOW], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = ELEVATION_BELOW; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[LEVEL], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = ELEVATION_LEVEL; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[ABOVE], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = ELEVATION_ABOVE; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[HIGHER], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = ELEVATION_HIGHER; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[LOWER], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -642,8 +611,7 @@ css_error parse_pause(css_language *c, /* Deal with inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { uint32_t *bytecode; @@ -681,8 +649,7 @@ css_error parse_pause(css_language *c, /* Ensure that we're not about to parse another inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { error = CSS_INVALID; @@ -848,8 +815,7 @@ css_error parse_pitch_range(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; @@ -934,43 +900,37 @@ css_error parse_pitch(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[X_LOW], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = PITCH_X_LOW; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[LOW], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = PITCH_LOW; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[MEDIUM], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = PITCH_MEDIUM; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[HIGH], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = PITCH_HIGH; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[X_HIGH], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -1059,18 +1019,15 @@ css_error parse_play_during(css_language *c, } if (token->type == CSS_TOKEN_IDENT) { - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = PLAY_DURING_NONE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { value = PLAY_DURING_AUTO; @@ -1084,7 +1041,7 @@ css_error parse_play_during(css_language *c, value = PLAY_DURING_URI; error = c->sheet->resolve(c->sheet->resolve_pw, - c->sheet->dictionary, c->sheet->url, + c->sheet->url, token->idata, &uri); if (error != CSS_OK) { *ctx = orig_ctx; @@ -1096,8 +1053,7 @@ css_error parse_play_during(css_language *c, token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT) { - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[MIX], &match) == lwc_error_ok && match)) { @@ -1107,8 +1063,7 @@ css_error parse_play_during(css_language *c, *ctx = orig_ctx; return CSS_INVALID; } - } else if (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if (lwc_string_caseless_isequal( token->idata, c->strings[REPEAT], &match) == lwc_error_ok && @@ -1191,8 +1146,7 @@ css_error parse_richness(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; @@ -1273,18 +1227,15 @@ css_error parse_speak_header(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[ONCE], &match) == lwc_error_ok && match)) { value = SPEAK_HEADER_ONCE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[ALWAYS], &match) == lwc_error_ok && match)) { value = SPEAK_HEADER_ALWAYS; @@ -1341,18 +1292,15 @@ css_error parse_speak_numeral(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[DIGITS], &match) == lwc_error_ok && match)) { value = SPEAK_NUMERAL_DIGITS; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[CONTINUOUS], &match) == lwc_error_ok && match)) { value = SPEAK_NUMERAL_CONTINUOUS; @@ -1409,18 +1357,15 @@ css_error parse_speak_punctuation(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[CODE], &match) == lwc_error_ok && match)) { value = SPEAK_PUNCTUATION_CODE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = SPEAK_PUNCTUATION_NONE; @@ -1477,23 +1422,19 @@ css_error parse_speak(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NORMAL], &match) == lwc_error_ok && match)) { value = SPEAK_NORMAL; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = SPEAK_NONE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[SPELL_OUT], &match) == lwc_error_ok && match)) { value = SPEAK_SPELL_OUT; @@ -1556,50 +1497,42 @@ css_error parse_speech_rate(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[X_SLOW], &match) == lwc_error_ok && match)) { value = SPEECH_RATE_X_SLOW; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[SLOW], &match) == lwc_error_ok && match)) { value = SPEECH_RATE_SLOW; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[MEDIUM], &match) == lwc_error_ok && match)) { value = SPEECH_RATE_MEDIUM; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[FAST], &match) == lwc_error_ok && match)) { value = SPEECH_RATE_FAST; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[X_FAST], &match) == lwc_error_ok && match)) { value = SPEECH_RATE_X_FAST; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[FASTER], &match) == lwc_error_ok && match)) { value = SPEECH_RATE_FASTER; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[SLOWER], &match) == lwc_error_ok && match)) { value = SPEECH_RATE_SLOWER; @@ -1683,8 +1616,7 @@ css_error parse_stress(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; @@ -1742,16 +1674,13 @@ static bool voice_family_reserved(css_language *c, const css_token *ident) { bool match; - return (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + return (lwc_string_caseless_isequal( ident->idata, c->strings[MALE], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( ident->idata, c->strings[FEMALE], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( ident->idata, c->strings[CHILD], &match) == lwc_error_ok && match); } @@ -1769,18 +1698,15 @@ static uint16_t voice_family_value(css_language *c, const css_token *token) bool match; if (token->type == CSS_TOKEN_IDENT) { - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[MALE], &match) == lwc_error_ok && match)) value = VOICE_FAMILY_MALE; - else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + else if ((lwc_string_caseless_isequal( token->idata, c->strings[FEMALE], &match) == lwc_error_ok && match)) value = VOICE_FAMILY_FEMALE; - else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + else if ((lwc_string_caseless_isequal( token->idata, c->strings[CHILD], &match) == lwc_error_ok && match)) value = VOICE_FAMILY_CHILD; @@ -1837,8 +1763,7 @@ css_error parse_voice_family(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags = FLAG_INHERIT; @@ -1882,8 +1807,7 @@ css_error parse_voice_family(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { /* Nothing to do */ @@ -1946,50 +1870,43 @@ css_error parse_volume(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[SILENT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = VOLUME_SILENT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[X_SOFT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = VOLUME_X_SOFT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[SOFT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = VOLUME_SOFT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[MEDIUM], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = VOLUME_MEDIUM; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[LOUD], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = VOLUME_LOUD; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[X_LOUD], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -2099,14 +2016,12 @@ css_error parse_cue_common(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = CUE_AFTER_NONE; @@ -2114,7 +2029,7 @@ css_error parse_cue_common(css_language *c, value = CUE_AFTER_URI; error = c->sheet->resolve(c->sheet->resolve_pw, - c->sheet->dictionary, c->sheet->url, + c->sheet->url, token->idata, &uri); if (error != CSS_OK) { *ctx = orig_ctx; @@ -2187,8 +2102,7 @@ css_error parse_pause_common(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); diff --git a/src/parse/properties/background.c b/src/parse/properties/background.c index fb96469..7403424 100644 --- a/src/parse/properties/background.c +++ b/src/parse/properties/background.c @@ -47,8 +47,7 @@ css_error parse_background(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { uint32_t *bytecode; @@ -279,18 +278,15 @@ css_error parse_background_attachment(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[FIXED], &match) == lwc_error_ok && match)) { value = BACKGROUND_ATTACHMENT_FIXED; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[SCROLL], &match) == lwc_error_ok && match)) { value = BACKGROUND_ATTACHMENT_SCROLL; @@ -350,15 +346,13 @@ css_error parse_background_color(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags |= FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[TRANSPARENT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -433,14 +427,12 @@ css_error parse_background_image(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = BACKGROUND_IMAGE_NONE; @@ -448,7 +440,7 @@ css_error parse_background_image(css_language *c, value = BACKGROUND_IMAGE_URI; error = c->sheet->resolve(c->sheet->resolve_pw, - c->sheet->dictionary, c->sheet->url, + c->sheet->url, token->idata, &uri); if (error != CSS_OK) { *ctx = orig_ctx; @@ -521,8 +513,7 @@ css_error parse_background_position(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -536,36 +527,31 @@ css_error parse_background_position(css_language *c, break; if (token->type == CSS_TOKEN_IDENT) { - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[LEFT], &match) == lwc_error_ok && match)) { value[i] = BACKGROUND_POSITION_HORZ_LEFT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[RIGHT], &match) == lwc_error_ok && match)) { value[i] = BACKGROUND_POSITION_HORZ_RIGHT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[TOP], &match) == lwc_error_ok && match)) { value[i] = BACKGROUND_POSITION_VERT_TOP; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[BOTTOM], &match) == lwc_error_ok && match)) { value[i] = BACKGROUND_POSITION_VERT_BOTTOM; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[CENTER], &match) == lwc_error_ok && @@ -732,28 +718,23 @@ css_error parse_background_repeat(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NO_REPEAT], &match) == lwc_error_ok && match)) { value = BACKGROUND_REPEAT_NO_REPEAT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[REPEAT_X], &match) == lwc_error_ok && match)) { value = BACKGROUND_REPEAT_REPEAT_X; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[REPEAT_Y], &match) == lwc_error_ok && match)) { value = BACKGROUND_REPEAT_REPEAT_Y; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[REPEAT], &match) == lwc_error_ok && match)) { value = BACKGROUND_REPEAT_REPEAT; diff --git a/src/parse/properties/border_outline.c b/src/parse/properties/border_outline.c index d81495a..b04f6cb 100644 --- a/src/parse/properties/border_outline.c +++ b/src/parse/properties/border_outline.c @@ -243,18 +243,15 @@ css_error parse_border_collapse(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[COLLAPSE], &match) == lwc_error_ok && match)) { value = BORDER_COLLAPSE_COLLAPSE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[SEPARATE], &match) == lwc_error_ok && match)) { value = BORDER_COLLAPSE_SEPARATE; @@ -312,8 +309,7 @@ css_error parse_border_color(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { uint32_t *bytecode; @@ -355,8 +351,7 @@ css_error parse_border_color(css_language *c, /* Ensure that we're not about to parse another inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { error = CSS_INVALID; @@ -743,8 +738,7 @@ css_error parse_border_spacing(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -870,8 +864,7 @@ css_error parse_border_style(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { uint32_t *bytecode; @@ -913,8 +906,7 @@ css_error parse_border_style(css_language *c, /* Ensure that we're not about to parse another inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { error = CSS_INVALID; @@ -1211,8 +1203,7 @@ css_error parse_border_width(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { uint32_t *bytecode; @@ -1254,8 +1245,7 @@ css_error parse_border_width(css_language *c, /* Ensure that we're not about to parse another inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { error = CSS_INVALID; @@ -1463,8 +1453,7 @@ css_error parse_outline(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { uint32_t *bytecode; @@ -1504,8 +1493,7 @@ css_error parse_outline(css_language *c, /* Ensure that we're not about to parse another inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { error = CSS_INVALID; @@ -1652,15 +1640,13 @@ css_error parse_outline_color(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags |= FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INVERT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -1798,8 +1784,7 @@ css_error parse_border_side(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { uint32_t *bytecode; @@ -1839,8 +1824,7 @@ css_error parse_border_side(css_language *c, /* Ensure that we're not about to parse another inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { error = CSS_INVALID; @@ -1983,15 +1967,13 @@ css_error parse_border_side_color(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags |= FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[TRANSPARENT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -2064,58 +2046,47 @@ css_error parse_border_side_style(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = BORDER_STYLE_NONE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[HIDDEN], &match) == lwc_error_ok && match)) { value = BORDER_STYLE_HIDDEN; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[DOTTED], &match) == lwc_error_ok && match)) { value = BORDER_STYLE_DOTTED; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[DASHED], &match) == lwc_error_ok && match)) { value = BORDER_STYLE_DASHED; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[SOLID], &match) == lwc_error_ok && match)) { value = BORDER_STYLE_SOLID; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[DOUBLE], &match) == lwc_error_ok && match)) { value = BORDER_STYLE_DOUBLE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[GROOVE], &match) == lwc_error_ok && match)) { value = BORDER_STYLE_GROOVE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[RIDGE], &match) == lwc_error_ok && match)) { value = BORDER_STYLE_RIDGE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[INSET], &match) == lwc_error_ok && match)) { value = BORDER_STYLE_INSET; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[OUTSET], &match) == lwc_error_ok && match)) { value = BORDER_STYLE_OUTSET; @@ -2177,29 +2148,25 @@ css_error parse_border_side_width(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags |= FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[THIN], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = BORDER_WIDTH_THIN; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[MEDIUM], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = BORDER_WIDTH_MEDIUM; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[THICK], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); diff --git a/src/parse/properties/display_sizing.c b/src/parse/properties/display_sizing.c index c25813b..bfa4821 100644 --- a/src/parse/properties/display_sizing.c +++ b/src/parse/properties/display_sizing.c @@ -48,88 +48,71 @@ css_error parse_display(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[INLINE], &match) == lwc_error_ok && match)) { value = DISPLAY_INLINE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[BLOCK], &match) == lwc_error_ok && match)) { value = DISPLAY_BLOCK; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LIST_ITEM], &match) == lwc_error_ok && match)) { value = DISPLAY_LIST_ITEM; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[RUN_IN], &match) == lwc_error_ok && match)) { value = DISPLAY_RUN_IN; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[INLINE_BLOCK], &match) == lwc_error_ok && match)) { value = DISPLAY_INLINE_BLOCK; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[TABLE], &match) == lwc_error_ok && match)) { value = DISPLAY_TABLE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[INLINE_TABLE], &match) == lwc_error_ok && match)) { value = DISPLAY_INLINE_TABLE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[TABLE_ROW_GROUP], &match) == lwc_error_ok && match)) { value = DISPLAY_TABLE_ROW_GROUP; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[TABLE_HEADER_GROUP], &match) == lwc_error_ok && match)) { value = DISPLAY_TABLE_HEADER_GROUP; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[TABLE_FOOTER_GROUP], &match) == lwc_error_ok && match)) { value = DISPLAY_TABLE_FOOTER_GROUP; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[TABLE_ROW], &match) == lwc_error_ok && match)) { value = DISPLAY_TABLE_ROW; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[TABLE_COLUMN_GROUP], &match) == lwc_error_ok && match)) { value = DISPLAY_TABLE_COLUMN_GROUP; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[TABLE_COLUMN], &match) == lwc_error_ok && match)) { value = DISPLAY_TABLE_COLUMN; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[TABLE_CELL], &match) == lwc_error_ok && match)) { value = DISPLAY_TABLE_CELL; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[TABLE_CAPTION], &match) == lwc_error_ok && match)) { value = DISPLAY_TABLE_CAPTION; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = DISPLAY_NONE; @@ -190,15 +173,13 @@ css_error parse_height(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -287,15 +268,13 @@ css_error parse_line_height(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NORMAL], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -404,15 +383,13 @@ css_error parse_max_height(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -501,15 +478,13 @@ css_error parse_max_width(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -598,8 +573,7 @@ css_error parse_min_height(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -688,8 +662,7 @@ css_error parse_min_width(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -778,15 +751,13 @@ css_error parse_width(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); diff --git a/src/parse/properties/effects_stacking.c b/src/parse/properties/effects_stacking.c index ad3e4d7..f032db4 100644 --- a/src/parse/properties/effects_stacking.c +++ b/src/parse/properties/effects_stacking.c @@ -52,20 +52,17 @@ css_error parse_clip(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { value = CLIP_AUTO; } else if (token->type == CSS_TOKEN_FUNCTION && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[RECT], &match) == lwc_error_ok && match)) { int i; @@ -83,8 +80,7 @@ css_error parse_clip(css_language *c, if (token->type == CSS_TOKEN_IDENT) { /* Slightly magical way of generating the auto * values. These are bits 3-6 of the value. */ - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) @@ -211,28 +207,23 @@ css_error parse_overflow(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[VISIBLE], &match) == lwc_error_ok && match)) { value = OVERFLOW_VISIBLE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[HIDDEN], &match) == lwc_error_ok && match)) { value = OVERFLOW_HIDDEN; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[SCROLL], &match) == lwc_error_ok && match)) { value = OVERFLOW_SCROLL; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { value = OVERFLOW_AUTO; @@ -289,23 +280,19 @@ css_error parse_visibility(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[VISIBLE], &match) == lwc_error_ok && match)) { value = VISIBILITY_VISIBLE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[HIDDEN], &match) == lwc_error_ok && match)) { value = VISIBILITY_HIDDEN; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[COLLAPSE], &match) == lwc_error_ok && match)) { value = VISIBILITY_COLLAPSE; @@ -366,14 +353,12 @@ css_error parse_z_index(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { value = Z_INDEX_AUTO; diff --git a/src/parse/properties/font.c b/src/parse/properties/font.c index e45f46f..288b7f2 100644 --- a/src/parse/properties/font.c +++ b/src/parse/properties/font.c @@ -49,8 +49,7 @@ css_error parse_font(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { uint32_t *bytecode; @@ -96,8 +95,7 @@ css_error parse_font(css_language *c, /* Ensure that we're not about to parse another inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { error = CSS_INVALID; @@ -130,8 +128,7 @@ css_error parse_font(css_language *c, /* Ensure that we're not about to parse another inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { error = CSS_INVALID; @@ -155,8 +152,7 @@ css_error parse_font(css_language *c, /* Ensure that we're not about to parse another inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { error = CSS_INVALID; @@ -173,8 +169,7 @@ css_error parse_font(css_language *c, /* Ensure that we're not about to parse another inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { error = CSS_INVALID; @@ -322,24 +317,19 @@ static bool font_family_reserved(css_language *c, const css_token *ident) { bool match; - return (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + return (lwc_string_caseless_isequal( ident->idata, c->strings[SERIF], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( ident->idata, c->strings[SANS_SERIF], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( ident->idata, c->strings[CURSIVE], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( ident->idata, c->strings[FANTASY], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( ident->idata, c->strings[MONOSPACE], &match) == lwc_error_ok && match); } @@ -357,28 +347,23 @@ static uint16_t font_family_value(css_language *c, const css_token *token) bool match; if (token->type == CSS_TOKEN_IDENT) { - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[SERIF], &match) == lwc_error_ok && match)) value = FONT_FAMILY_SERIF; - else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + else if ((lwc_string_caseless_isequal( token->idata, c->strings[SANS_SERIF], &match) == lwc_error_ok && match)) value = FONT_FAMILY_SANS_SERIF; - else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + else if ((lwc_string_caseless_isequal( token->idata, c->strings[CURSIVE], &match) == lwc_error_ok && match)) value = FONT_FAMILY_CURSIVE; - else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + else if ((lwc_string_caseless_isequal( token->idata, c->strings[FANTASY], &match) == lwc_error_ok && match)) value = FONT_FAMILY_FANTASY; - else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + else if ((lwc_string_caseless_isequal( token->idata, c->strings[MONOSPACE], &match) == lwc_error_ok && match)) value = FONT_FAMILY_MONOSPACE; @@ -438,8 +423,7 @@ css_error parse_font_family(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags = FLAG_INHERIT; @@ -483,8 +467,7 @@ css_error parse_font_family(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { /* Nothing to do */ @@ -546,71 +529,61 @@ css_error parse_font_size(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[XX_SMALL], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = FONT_SIZE_XX_SMALL; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[X_SMALL], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = FONT_SIZE_X_SMALL; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[SMALL], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = FONT_SIZE_SMALL; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[MEDIUM], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = FONT_SIZE_MEDIUM; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[LARGE], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = FONT_SIZE_LARGE; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[X_LARGE], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = FONT_SIZE_X_LARGE; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[XX_LARGE], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = FONT_SIZE_XX_LARGE; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[LARGER], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = FONT_SIZE_LARGER; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[SMALLER], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -695,23 +668,19 @@ css_error parse_font_style(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NORMAL], &match) == lwc_error_ok && match)) { value = FONT_STYLE_NORMAL; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[ITALIC], &match) == lwc_error_ok && match)) { value = FONT_STYLE_ITALIC; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[OBLIQUE], &match) == lwc_error_ok && match)) { value = FONT_STYLE_OBLIQUE; @@ -768,18 +737,15 @@ css_error parse_font_variant(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NORMAL], &match) == lwc_error_ok && match)) { value = FONT_VARIANT_NORMAL; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[SMALL_CAPS], &match) == lwc_error_ok && match)) { value = FONT_VARIANT_SMALL_CAPS; @@ -838,8 +804,7 @@ css_error parse_font_weight(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; @@ -865,23 +830,19 @@ css_error parse_font_weight(css_language *c, case 900: value = FONT_WEIGHT_900; break; default: *ctx = orig_ctx; return CSS_INVALID; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[NORMAL], &match) == lwc_error_ok && match)) { value = FONT_WEIGHT_NORMAL; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[BOLD], &match) == lwc_error_ok && match)) { value = FONT_WEIGHT_BOLD; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[BOLDER], &match) == lwc_error_ok && match)) { value = FONT_WEIGHT_BOLDER; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[LIGHTER], &match) == lwc_error_ok && match)) { value = FONT_WEIGHT_LIGHTER; diff --git a/src/parse/properties/generated_list.c b/src/parse/properties/generated_list.c index 71de141..423ba74 100644 --- a/src/parse/properties/generated_list.c +++ b/src/parse/properties/generated_list.c @@ -69,22 +69,19 @@ css_error parse_content(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags = FLAG_INHERIT; parserutils_vector_iterate(vector, &temp_ctx); } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NORMAL], &match) == lwc_error_ok && match)) { value = CONTENT_NORMAL; parserutils_vector_iterate(vector, &temp_ctx); } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = CONTENT_NONE; @@ -124,16 +121,13 @@ css_error parse_content(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + ((lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NORMAL], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NONE], &match) == lwc_error_ok && match))) { parserutils_vector_iterate(vector, ctx); @@ -224,8 +218,7 @@ css_error parse_list_style(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { uint32_t *bytecode; @@ -265,8 +258,7 @@ css_error parse_list_style(css_language *c, /* Ensure that we're not about to parse another inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { error = CSS_INVALID; @@ -416,14 +408,12 @@ css_error parse_list_style_image(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = LIST_STYLE_IMAGE_NONE; @@ -431,7 +421,7 @@ css_error parse_list_style_image(css_language *c, value = LIST_STYLE_IMAGE_URI; error = c->sheet->resolve(c->sheet->resolve_pw, - c->sheet->dictionary, c->sheet->url, + c->sheet->url, token->idata, &uri); if (error != CSS_OK) { *ctx = orig_ctx; @@ -499,18 +489,15 @@ css_error parse_list_style_position(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[INSIDE], &match) == lwc_error_ok && match)) { value = LIST_STYLE_POSITION_INSIDE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[OUTSIDE], &match) == lwc_error_ok && match)) { value = LIST_STYLE_POSITION_OUTSIDE; @@ -571,8 +558,7 @@ css_error parse_list_style_type(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; @@ -639,13 +625,11 @@ css_error parse_quotes(css_language *c, } if (token->type == CSS_TOKEN_IDENT) { - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags = FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = QUOTES_NONE; @@ -746,11 +730,11 @@ css_error parse_quotes(css_language *c, ptr += sizeof(opv); } - lwc_context_string_ref(c->sheet->dictionary, open); + lwc_string_ref(open); memcpy(ptr, &open, sizeof(open)); ptr += sizeof(open); - lwc_context_string_ref(c->sheet->dictionary, close); + lwc_string_ref(close); memcpy(ptr, &close, sizeof(close)); ptr += sizeof(close); @@ -790,78 +774,63 @@ css_error parse_list_style_type_value(css_language *c, const css_token *ident, * upper-latin, armenian, georgian, lower-alpha, upper-alpha, * none) */ - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[DISC], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_DISC; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[CIRCLE], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_CIRCLE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[SQUARE], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_SQUARE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[DECIMAL], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_DECIMAL; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[DECIMAL_LEADING_ZERO], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_DECIMAL_LEADING_ZERO; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LOWER_ROMAN], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_LOWER_ROMAN; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[UPPER_ROMAN], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_UPPER_ROMAN; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LOWER_GREEK], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_LOWER_GREEK; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LOWER_LATIN], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_LOWER_LATIN; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[UPPER_LATIN], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_UPPER_LATIN; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[ARMENIAN], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_ARMENIAN; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[GEORGIAN], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_GEORGIAN; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LOWER_ALPHA], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_LOWER_ALPHA; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[UPPER_ALPHA], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_UPPER_ALPHA; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { *value = LIST_STYLE_TYPE_NONE; @@ -916,8 +885,7 @@ css_error parse_content_list(css_language *c, while (token != NULL) { if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[OPEN_QUOTE], &match) == lwc_error_ok && match)) { opv = CONTENT_OPEN_QUOTE; @@ -931,8 +899,7 @@ css_error parse_content_list(css_language *c, offset += sizeof(opv); } } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[CLOSE_QUOTE], &match) == lwc_error_ok && match)) { opv = CONTENT_CLOSE_QUOTE; @@ -946,8 +913,7 @@ css_error parse_content_list(css_language *c, offset += sizeof(opv); } } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NO_OPEN_QUOTE], &match) == lwc_error_ok && match)) { opv = CONTENT_NO_OPEN_QUOTE; @@ -961,8 +927,7 @@ css_error parse_content_list(css_language *c, offset += sizeof(opv); } } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NO_CLOSE_QUOTE], &match) == lwc_error_ok && match)) { opv = CONTENT_NO_CLOSE_QUOTE; @@ -988,8 +953,7 @@ css_error parse_content_list(css_language *c, } if (buffer != NULL) { - lwc_context_string_ref(c->sheet->dictionary, - token->idata); + lwc_string_ref(token->idata); memcpy(buffer + offset, &token->idata, sizeof(token->idata)); } @@ -1011,7 +975,7 @@ css_error parse_content_list(css_language *c, if (buffer != NULL) { error = c->sheet->resolve(c->sheet->resolve_pw, - c->sheet->dictionary, c->sheet->url, + c->sheet->url, token->idata, &uri); if (error != CSS_OK) { *ctx = orig_ctx; @@ -1025,8 +989,7 @@ css_error parse_content_list(css_language *c, offset += sizeof(uri); } else if (token->type == CSS_TOKEN_FUNCTION && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[ATTR], &match) == lwc_error_ok && match)) { opv = CONTENT_ATTR; @@ -1050,8 +1013,7 @@ css_error parse_content_list(css_language *c, } if (buffer != NULL) { - lwc_context_string_ref(c->sheet->dictionary, - token->idata); + lwc_string_ref(token->idata); memcpy(buffer + offset, &token->idata, sizeof(token->idata)); } @@ -1067,8 +1029,7 @@ css_error parse_content_list(css_language *c, return CSS_INVALID; } } else if (token->type == CSS_TOKEN_FUNCTION && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[COUNTER], &match) == lwc_error_ok && match)) { lwc_string *name; @@ -1146,15 +1107,13 @@ css_error parse_content_list(css_language *c, } if (buffer != NULL) { - lwc_context_string_ref(c->sheet->dictionary, - name); + lwc_string_ref(name); memcpy(buffer + offset, &name, sizeof(name)); } offset += sizeof(name); } else if (token->type == CSS_TOKEN_FUNCTION && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[COUNTERS], &match) == lwc_error_ok && match)) { lwc_string *name; @@ -1253,16 +1212,14 @@ css_error parse_content_list(css_language *c, } if (buffer != NULL) { - lwc_context_string_ref(c->sheet->dictionary, - name); + lwc_string_ref(name); memcpy(buffer + offset, &name, sizeof(name)); } offset += sizeof(name); if (buffer != NULL) { - lwc_context_string_ref(c->sheet->dictionary, - sep); + lwc_string_ref(sep); memcpy(buffer + offset, &sep, sizeof(sep)); } @@ -1343,13 +1300,11 @@ css_error parse_counter_common(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags = FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = COUNTER_INCREMENT_NONE; @@ -1431,12 +1386,10 @@ css_error parse_counter_common(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match) || - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { /* Nothing to do */ @@ -1483,7 +1436,7 @@ css_error parse_counter_common(css_language *c, ptr += sizeof(opv); } - lwc_context_string_ref(c->sheet->dictionary, name); + lwc_string_ref(name); memcpy(ptr, &name, sizeof(name)); ptr += sizeof(name); diff --git a/src/parse/properties/margin.c b/src/parse/properties/margin.c index a0aa6b9..456e6ee 100644 --- a/src/parse/properties/margin.c +++ b/src/parse/properties/margin.c @@ -51,8 +51,7 @@ css_error parse_margin(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { uint32_t *bytecode; @@ -94,8 +93,7 @@ css_error parse_margin(css_language *c, /* Ensure that we're not about to parse another inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { error = CSS_INVALID; @@ -389,15 +387,13 @@ css_error parse_margin_side(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); diff --git a/src/parse/properties/padding.c b/src/parse/properties/padding.c index 3a77c26..8562d20 100644 --- a/src/parse/properties/padding.c +++ b/src/parse/properties/padding.c @@ -51,8 +51,7 @@ css_error parse_padding(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { uint32_t *bytecode; @@ -94,8 +93,7 @@ css_error parse_padding(css_language *c, /* Ensure that we're not about to parse another inherit */ token = parserutils_vector_peek(vector, *ctx); if (token != NULL && token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { error = CSS_INVALID; @@ -392,8 +390,7 @@ css_error parse_padding_side(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); diff --git a/src/parse/properties/page.c b/src/parse/properties/page.c index cc2d734..d28ed15 100644 --- a/src/parse/properties/page.c +++ b/src/parse/properties/page.c @@ -48,8 +48,7 @@ css_error parse_orphans(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; @@ -130,33 +129,27 @@ css_error parse_page_break_after(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { value = PAGE_BREAK_AFTER_AUTO; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[ALWAYS], &match) == lwc_error_ok && match)) { value = PAGE_BREAK_AFTER_ALWAYS; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[AVOID], &match) == lwc_error_ok && match)) { value = PAGE_BREAK_AFTER_AVOID; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LEFT], &match) == lwc_error_ok && match)) { value = PAGE_BREAK_AFTER_LEFT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[RIGHT], &match) == lwc_error_ok && match)) { value = PAGE_BREAK_AFTER_RIGHT; @@ -213,33 +206,27 @@ css_error parse_page_break_before(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { value = PAGE_BREAK_BEFORE_AUTO; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[ALWAYS], &match) == lwc_error_ok && match)) { value = PAGE_BREAK_BEFORE_ALWAYS; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[AVOID], &match) == lwc_error_ok && match)) { value = PAGE_BREAK_BEFORE_AVOID; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LEFT], &match) == lwc_error_ok && match)) { value = PAGE_BREAK_BEFORE_LEFT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[RIGHT], &match) == lwc_error_ok && match)) { value = PAGE_BREAK_BEFORE_RIGHT; @@ -296,18 +283,15 @@ css_error parse_page_break_inside(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { value = PAGE_BREAK_INSIDE_AUTO; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[AVOID], &match) == lwc_error_ok && match)) { value = PAGE_BREAK_INSIDE_AVOID; @@ -367,8 +351,7 @@ css_error parse_widows(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; diff --git a/src/parse/properties/positioning.c b/src/parse/properties/positioning.c index 813b113..c4393aa 100644 --- a/src/parse/properties/positioning.c +++ b/src/parse/properties/positioning.c @@ -133,28 +133,23 @@ css_error parse_position(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[STATIC], &match) == lwc_error_ok && match)) { value = POSITION_STATIC; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[RELATIVE], &match) == lwc_error_ok && match)) { value = POSITION_RELATIVE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[ABSOLUTE], &match) == lwc_error_ok && match)) { value = POSITION_ABSOLUTE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[FIXED], &match) == lwc_error_ok && match)) { value = POSITION_FIXED; @@ -211,28 +206,23 @@ css_error parse_clear(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[RIGHT], &match) == lwc_error_ok && match)) { value = CLEAR_RIGHT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LEFT], &match) == lwc_error_ok && match)) { value = CLEAR_LEFT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[BOTH], &match) == lwc_error_ok && match)) { value = CLEAR_BOTH; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = CLEAR_NONE; @@ -289,23 +279,19 @@ css_error parse_float(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LEFT], &match) == lwc_error_ok && match)) { value = FLOAT_LEFT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[RIGHT], &match) == lwc_error_ok && match)) { value = FLOAT_RIGHT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = FLOAT_NONE; @@ -368,64 +354,55 @@ css_error parse_vertical_align(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[BASELINE], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = VERTICAL_ALIGN_BASELINE; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[SUB], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = VERTICAL_ALIGN_SUB; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[SUPER], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = VERTICAL_ALIGN_SUPER; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[TOP], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = VERTICAL_ALIGN_TOP; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[TEXT_TOP], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = VERTICAL_ALIGN_TEXT_TOP; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[MIDDLE], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = VERTICAL_ALIGN_MIDDLE; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[BOTTOM], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); value = VERTICAL_ALIGN_BOTTOM; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[TEXT_BOTTOM], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -509,15 +486,13 @@ css_error parse_side(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); diff --git a/src/parse/properties/table.c b/src/parse/properties/table.c index 51f3bdc..61c0d85 100644 --- a/src/parse/properties/table.c +++ b/src/parse/properties/table.c @@ -45,18 +45,15 @@ css_error parse_caption_side(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[TOP], &match) == lwc_error_ok && match)) { value = CAPTION_SIDE_TOP; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[BOTTOM], &match) == lwc_error_ok && match)) { value = CAPTION_SIDE_BOTTOM; @@ -113,18 +110,15 @@ css_error parse_empty_cells(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[SHOW], &match) == lwc_error_ok && match)) { value = EMPTY_CELLS_SHOW; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[HIDE], &match) == lwc_error_ok && match)) { value = EMPTY_CELLS_HIDE; @@ -181,18 +175,15 @@ css_error parse_table_layout(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { value = TABLE_LAYOUT_AUTO; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[FIXED], &match) == lwc_error_ok && match)) { value = TABLE_LAYOUT_FIXED; diff --git a/src/parse/properties/text.c b/src/parse/properties/text.c index 45b9b5a..b019692 100644 --- a/src/parse/properties/text.c +++ b/src/parse/properties/text.c @@ -48,8 +48,7 @@ css_error parse_color(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -120,18 +119,15 @@ css_error parse_direction(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LTR], &match) == lwc_error_ok && match)) { value = DIRECTION_LTR; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[RTL], &match) == lwc_error_ok && match)) { value = DIRECTION_RTL; @@ -192,15 +188,13 @@ css_error parse_letter_spacing(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NORMAL], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -281,43 +275,35 @@ css_error parse_text_align(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LEFT], &match) == lwc_error_ok && match)) { value = TEXT_ALIGN_LEFT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[RIGHT], &match) == lwc_error_ok && match)) { value = TEXT_ALIGN_RIGHT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[CENTER], &match) == lwc_error_ok && match)) { value = TEXT_ALIGN_CENTER; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[JUSTIFY], &match) == lwc_error_ok && match)) { value = TEXT_ALIGN_JUSTIFY; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LIBCSS_LEFT], &match) == lwc_error_ok && match)) { value = TEXT_ALIGN_LIBCSS_LEFT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LIBCSS_CENTER], &match) == lwc_error_ok && match)) { value = TEXT_ALIGN_LIBCSS_CENTER; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LIBCSS_RIGHT], &match) == lwc_error_ok && match)) { value = TEXT_ALIGN_LIBCSS_RIGHT; @@ -375,20 +361,17 @@ css_error parse_text_decoration(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = TEXT_DECORATION_NONE; } else { while (ident != NULL) { - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[UNDERLINE], &match) == lwc_error_ok && match)) { if ((value & TEXT_DECORATION_UNDERLINE) == 0) @@ -397,8 +380,7 @@ css_error parse_text_decoration(css_language *c, *ctx = orig_ctx; return CSS_INVALID; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[OVERLINE], &match) == lwc_error_ok && match)) { if ((value & TEXT_DECORATION_OVERLINE) == 0) @@ -407,8 +389,7 @@ css_error parse_text_decoration(css_language *c, *ctx = orig_ctx; return CSS_INVALID; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LINE_THROUGH], &match) == lwc_error_ok && match)) { if ((value & TEXT_DECORATION_LINE_THROUGH) == 0) @@ -417,8 +398,7 @@ css_error parse_text_decoration(css_language *c, *ctx = orig_ctx; return CSS_INVALID; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[BLINK], &match) == lwc_error_ok && match)) { if ((value & TEXT_DECORATION_BLINK) == 0) @@ -493,8 +473,7 @@ css_error parse_text_indent(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); @@ -573,28 +552,23 @@ css_error parse_text_transform(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[CAPITALIZE], &match) == lwc_error_ok && match)) { value = TEXT_TRANSFORM_CAPITALIZE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[UPPERCASE], &match) == lwc_error_ok && match)) { value = TEXT_TRANSFORM_UPPERCASE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[LOWERCASE], &match) == lwc_error_ok && match)) { value = TEXT_TRANSFORM_LOWERCASE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { value = TEXT_TRANSFORM_NONE; @@ -651,23 +625,19 @@ css_error parse_unicode_bidi(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NORMAL], &match) == lwc_error_ok && match)) { value = UNICODE_BIDI_NORMAL; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[EMBED], &match) == lwc_error_ok && match)) { value = UNICODE_BIDI_EMBED; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[BIDI_OVERRIDE], &match) == lwc_error_ok && match)) { value = UNICODE_BIDI_BIDI_OVERRIDE; @@ -724,33 +694,27 @@ css_error parse_white_space(css_language *c, return CSS_INVALID; } - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( ident->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags |= FLAG_INHERIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NORMAL], &match) == lwc_error_ok && match)) { value = WHITE_SPACE_NORMAL; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[PRE], &match) == lwc_error_ok && match)) { value = WHITE_SPACE_PRE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[NOWRAP], &match) == lwc_error_ok && match)) { value = WHITE_SPACE_NOWRAP; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[PRE_WRAP], &match) == lwc_error_ok && match)) { value = WHITE_SPACE_PRE_WRAP; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( ident->idata, c->strings[PRE_LINE], &match) == lwc_error_ok && match)) { value = WHITE_SPACE_PRE_LINE; @@ -811,15 +775,13 @@ css_error parse_word_spacing(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); flags = FLAG_INHERIT; } else if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[NORMAL], &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); diff --git a/src/parse/properties/ui.c b/src/parse/properties/ui.c index 93a3c5f..2184ac4 100644 --- a/src/parse/properties/ui.c +++ b/src/parse/properties/ui.c @@ -56,8 +56,7 @@ css_error parse_cursor(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { flags = FLAG_INHERIT; @@ -99,120 +98,103 @@ css_error parse_cursor(css_language *c, /* IDENT */ if (token != NULL && token->type == CSS_TOKEN_IDENT) { - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_AUTO; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[CROSSHAIR], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_CROSSHAIR; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[DEFAULT], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_DEFAULT; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[POINTER], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_POINTER; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[MOVE], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_MOVE; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[E_RESIZE], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_E_RESIZE; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[NE_RESIZE], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_NE_RESIZE; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[NW_RESIZE], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_NW_RESIZE; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[N_RESIZE], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_N_RESIZE; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[SE_RESIZE], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_SE_RESIZE; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[SW_RESIZE], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_SW_RESIZE; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[S_RESIZE], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_S_RESIZE; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[W_RESIZE], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_W_RESIZE; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[TEXT], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_TEXT; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[WAIT], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_WAIT; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[HELP], &match) == lwc_error_ok && match)) { if (first) { value = CURSOR_HELP; } - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[PROGRESS], &match) == lwc_error_ok && match)) { if (first) { @@ -252,8 +234,7 @@ css_error parse_cursor(css_language *c, } if (token->type == CSS_TOKEN_IDENT && - (lwc_context_string_caseless_isequal( - c->sheet->dictionary, + (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { /* Nothing to do */ @@ -265,7 +246,7 @@ css_error parse_cursor(css_language *c, lwc_string *uri; error = c->sheet->resolve(c->sheet->resolve_pw, - c->sheet->dictionary, c->sheet->url, + c->sheet->url, token->idata, &uri); if (error != CSS_OK) { *ctx = orig_ctx; @@ -307,88 +288,71 @@ css_error parse_cursor(css_language *c, /* IDENT */ if (token != NULL && token->type == CSS_TOKEN_IDENT) { - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { opv = CURSOR_AUTO; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[CROSSHAIR], &match) == lwc_error_ok && match)) { opv = CURSOR_CROSSHAIR; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[DEFAULT], &match) == lwc_error_ok && match)) { opv = CURSOR_DEFAULT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[POINTER], &match) == lwc_error_ok && match)) { opv = CURSOR_POINTER; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[MOVE], &match) == lwc_error_ok && match)) { opv = CURSOR_MOVE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[E_RESIZE], &match) == lwc_error_ok && match)) { opv = CURSOR_E_RESIZE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[NE_RESIZE], &match) == lwc_error_ok && match)) { opv = CURSOR_NE_RESIZE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[NW_RESIZE], &match) == lwc_error_ok && match)) { opv = CURSOR_NW_RESIZE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[N_RESIZE], &match) == lwc_error_ok && match)) { opv = CURSOR_N_RESIZE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[SE_RESIZE], &match) == lwc_error_ok && match)) { opv = CURSOR_SE_RESIZE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[SW_RESIZE], &match) == lwc_error_ok && match)) { opv = CURSOR_SW_RESIZE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[S_RESIZE], &match) == lwc_error_ok && match)) { opv = CURSOR_S_RESIZE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[W_RESIZE], &match) == lwc_error_ok && match)) { opv = CURSOR_W_RESIZE; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[TEXT], &match) == lwc_error_ok && match)) { opv = CURSOR_TEXT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[WAIT], &match) == lwc_error_ok && match)) { opv = CURSOR_WAIT; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[HELP], &match) == lwc_error_ok && match)) { opv = CURSOR_HELP; - } else if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + } else if ((lwc_string_caseless_isequal( token->idata, c->strings[PROGRESS], &match) == lwc_error_ok && match)) { opv = CURSOR_PROGRESS; diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c index 8676015..a0370c2 100644 --- a/src/parse/properties/utils.c +++ b/src/parse/properties/utils.c @@ -91,8 +91,7 @@ css_error parse_colour_specifier(css_language *c, return error; } else if (token->type == CSS_TOKEN_FUNCTION) { - if ((lwc_context_string_caseless_isequal( - c->sheet->dictionary, + if ((lwc_string_caseless_isequal( token->idata, c->strings[RGB], &match) == lwc_error_ok && match)) { int i; @@ -335,8 +334,8 @@ css_error parse_named_colour(css_language *c, lwc_string *data, bool match; for (i = FIRST_COLOUR; i <= LAST_COLOUR; i++) { - if (lwc_context_string_caseless_isequal(c->sheet->dictionary, - data, c->strings[i], &match) == lwc_error_ok && + if (lwc_string_caseless_isequal(data, c->strings[i], + &match) == lwc_error_ok && match) break; } @@ -783,8 +782,7 @@ css_error comma_list_to_bytecode(css_language *c, /* Insert into hash, if it's different * from the name we already have */ - lerror = lwc_context_intern( - c->sheet->dictionary, + lerror = lwc_intern_string( (char *) buf, p - buf, &newname); if (lerror != lwc_error_ok) { @@ -794,9 +792,7 @@ css_error comma_list_to_bytecode(css_language *c, } if (newname == name) { - lwc_context_string_unref( - c->sheet->dictionary, - newname); + lwc_string_unref(newname); } name = newname; @@ -806,8 +802,7 @@ css_error comma_list_to_bytecode(css_language *c, * new name generated above. */ if (name == tok_idata) { - lwc_context_string_ref( - c->sheet->dictionary, name); + lwc_string_ref(name); } memcpy(ptr, &name, sizeof(name)); @@ -821,8 +816,7 @@ css_error comma_list_to_bytecode(css_language *c, ptr += sizeof(opv); } - lwc_context_string_ref(c->sheet->dictionary, - token->idata); + lwc_string_ref(token->idata); memcpy(ptr, &token->idata, sizeof(token->idata)); ptr += sizeof(token->idata); -- cgit v1.2.3