summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libcss/select.h6
-rw-r--r--include/libcss/stylesheet.h4
-rw-r--r--src/parse/important.c3
-rw-r--r--src/parse/language.c107
-rw-r--r--src/parse/parse.c25
-rw-r--r--src/parse/parse.h4
-rw-r--r--src/parse/properties/aural.c262
-rw-r--r--src/parse/properties/background.c59
-rw-r--r--src/parse/properties/border_outline.c99
-rw-r--r--src/parse/properties/display_sizing.c87
-rw-r--r--src/parse/properties/effects_stacking.c45
-rw-r--r--src/parse/properties/font.c117
-rw-r--r--src/parse/properties/generated_list.c151
-rw-r--r--src/parse/properties/margin.c12
-rw-r--r--src/parse/properties/padding.c9
-rw-r--r--src/parse/properties/page.c51
-rw-r--r--src/parse/properties/positioning.c75
-rw-r--r--src/parse/properties/table.c27
-rw-r--r--src/parse/properties/text.c114
-rw-r--r--src/parse/properties/ui.c110
-rw-r--r--src/parse/properties/utils.c20
-rw-r--r--src/select/hash.c27
-rw-r--r--src/select/hash.h3
-rw-r--r--src/select/select.c80
-rw-r--r--src/stylesheet.c38
-rw-r--r--src/stylesheet.h2
-rw-r--r--src/utils/utils.h2
-rw-r--r--test/css21.c15
-rw-r--r--test/number.c8
-rw-r--r--test/parse-auto.c15
-rw-r--r--test/parse.c8
-rw-r--r--test/parse2-auto.c14
-rw-r--r--test/select-auto.c83
33 files changed, 590 insertions, 1092 deletions
diff --git a/include/libcss/select.h b/include/libcss/select.h
index 931dcf1..72e9767 100644
--- a/include/libcss/select.h
+++ b/include/libcss/select.h
@@ -25,12 +25,12 @@ enum css_pseudo_element {
typedef struct css_select_handler {
css_error (*node_name)(void *pw, void *node,
- lwc_context *dict, lwc_string **name);
+ lwc_string **name);
css_error (*node_classes)(void *pw, void *node,
- lwc_context *dict, lwc_string ***classes,
+ lwc_string ***classes,
uint32_t *n_classes);
css_error (*node_id)(void *pw, void *node,
- lwc_context *dict, lwc_string **id);
+ lwc_string **id);
css_error (*named_ancestor_node)(void *pw, void *node,
lwc_string *name, void **ancestor);
diff --git a/include/libcss/stylesheet.h b/include/libcss/stylesheet.h
index e70214d..b9cb5ab 100644
--- a/include/libcss/stylesheet.h
+++ b/include/libcss/stylesheet.h
@@ -21,12 +21,12 @@
* \param abs Pointer to location to receive result
* \return CSS_OK on success, appropriate error otherwise.
*/
-typedef css_error (*css_url_resolution_fn)(void *pw, lwc_context *dict,
+typedef css_error (*css_url_resolution_fn)(void *pw,
const char *base, lwc_string *rel, lwc_string **abs);
css_error css_stylesheet_create(css_language_level level,
const char *charset, const char *url, const char *title,
- bool allow_quirks, bool inline_style, lwc_context *dict,
+ bool allow_quirks, bool inline_style,
css_allocator_fn alloc, void *alloc_pw,
css_url_resolution_fn resolve, void *resolve_pw,
css_stylesheet **stylesheet);
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);
diff --git a/src/select/hash.c b/src/select/hash.c
index de01ca3..ed956a0 100644
--- a/src/select/hash.c
+++ b/src/select/hash.c
@@ -33,8 +33,6 @@ struct css_selector_hash {
hash_entry universal;
- lwc_context *ctx;
-
size_t hash_size;
css_allocator_fn alloc;
@@ -67,19 +65,17 @@ static css_error _iterate_universal(css_selector_hash *hash,
/**
* Create a hash
*
- * \param dict Dictionary containing interned strings
* \param alloc Memory (de)allocation function
* \param pw Pointer to client-specific private data
* \param hash Pointer to location to receive result
* \return CSS_OK on success, appropriate error otherwise
*/
-css_error css_selector_hash_create(lwc_context *dict,
- css_allocator_fn alloc, void *pw,
+css_error css_selector_hash_create(css_allocator_fn alloc, void *pw,
css_selector_hash **hash)
{
css_selector_hash *h;
- if (dict == NULL || alloc == NULL || hash == NULL)
+ if (alloc == NULL || hash == NULL)
return CSS_BADPARM;
h = alloc(0, sizeof(css_selector_hash), pw);
@@ -124,7 +120,6 @@ css_error css_selector_hash_create(lwc_context *dict,
DEFAULT_SLOTS * sizeof(hash_entry) +
DEFAULT_SLOTS * sizeof(hash_entry);
- h->ctx = lwc_context_ref(dict);
h->alloc = alloc;
h->pw = pw;
@@ -184,8 +179,6 @@ css_error css_selector_hash_destroy(css_selector_hash *hash)
hash->alloc(d, 0, hash->pw);
}
- lwc_context_unref(hash->ctx);
-
hash->alloc(hash, 0, hash->pw);
return CSS_OK;
@@ -321,7 +314,7 @@ css_error css_selector_hash_find(css_selector_hash *hash,
lwc_error lerror;
bool match = false;
- lerror = lwc_context_string_caseless_isequal(hash->ctx,
+ lerror = lwc_string_caseless_isequal(
name, head->sel->data.name, &match);
if (lerror != lwc_error_ok)
return css_error_from_lwc_error(lerror);
@@ -379,8 +372,8 @@ css_error css_selector_hash_find_by_class(css_selector_hash *hash,
n = _class_name(head->sel);
if (n != NULL) {
- lerror = lwc_context_string_caseless_isequal(
- hash->ctx, name, n, &match);
+ lerror = lwc_string_caseless_isequal(
+ name, n, &match);
if (lerror != lwc_error_ok)
return css_error_from_lwc_error(lerror);
@@ -438,8 +431,8 @@ css_error css_selector_hash_find_by_id(css_selector_hash *hash,
n = _id_name(head->sel);
if (n != NULL) {
- lerror = lwc_context_string_caseless_isequal(
- hash->ctx, name, n, &match);
+ lerror = lwc_string_caseless_isequal(
+ name, n, &match);
if (lerror != lwc_error_ok)
return css_error_from_lwc_error(lerror);
@@ -713,7 +706,7 @@ css_error _iterate_elements(css_selector_hash *hash,
lwc_error lerror = lwc_error_ok;
bool match = false;
- lerror = lwc_context_string_caseless_isequal(hash->ctx,
+ lerror = lwc_string_caseless_isequal(
name, head->sel->data.name, &match);
if (lerror != lwc_error_ok)
return css_error_from_lwc_error(lerror);
@@ -762,7 +755,7 @@ css_error _iterate_classes(css_selector_hash *hash,
if (name == NULL)
continue;
- lerror = lwc_context_string_caseless_isequal(hash->ctx,
+ lerror = lwc_string_caseless_isequal(
ref, name, &match);
if (lerror != lwc_error_ok)
return css_error_from_lwc_error(lerror);
@@ -811,7 +804,7 @@ css_error _iterate_ids(css_selector_hash *hash,
if (name == NULL)
continue;
- lerror = lwc_context_string_caseless_isequal(hash->ctx,
+ lerror = lwc_string_caseless_isequal(
ref, name, &match);
if (lerror != lwc_error_ok)
return css_error_from_lwc_error(lerror);
diff --git a/src/select/hash.h b/src/select/hash.h
index e705554..e1f2542 100644
--- a/src/select/hash.h
+++ b/src/select/hash.h
@@ -22,8 +22,7 @@ typedef css_error (*css_selector_hash_iterator)(css_selector_hash *hash,
const struct css_selector **current,
const struct css_selector ***next);
-css_error css_selector_hash_create(lwc_context *dict,
- css_allocator_fn alloc, void *pw,
+css_error css_selector_hash_create(css_allocator_fn alloc, void *pw,
css_selector_hash **hash);
css_error css_selector_hash_destroy(css_selector_hash *hash);
diff --git a/src/select/select.c b/src/select/select.c
index 7898d60..abf4099 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -389,49 +389,27 @@ css_error css_select_style(css_select_ctx *ctx, void *node,
cleanup:
if (ctx->n_sheets > 0 && ctx->sheets[0].sheet != NULL) {
if (state.universal != NULL)
- lwc_context_string_unref(
- ctx->sheets[0].sheet->dictionary,
- state.universal);
+ lwc_string_unref(state.universal);
if (state.first_child != NULL)
- lwc_context_string_unref(
- ctx->sheets[0].sheet->dictionary,
- state.first_child);
+ lwc_string_unref(state.first_child);
if (state.link != NULL)
- lwc_context_string_unref(
- ctx->sheets[0].sheet->dictionary,
- state.link);
+ lwc_string_unref(state.link);
if (state.visited != NULL)
- lwc_context_string_unref(
- ctx->sheets[0].sheet->dictionary,
- state.visited);
+ lwc_string_unref(state.visited);
if (state.hover != NULL)
- lwc_context_string_unref(
- ctx->sheets[0].sheet->dictionary,
- state.hover);
+ lwc_string_unref(state.hover);
if (state.active != NULL)
- lwc_context_string_unref(
- ctx->sheets[0].sheet->dictionary,
- state.active);
+ lwc_string_unref(state.active);
if (state.focus != NULL)
- lwc_context_string_unref(
- ctx->sheets[0].sheet->dictionary,
- state.focus);
+ lwc_string_unref(state.focus);
if (state.first_line != NULL)
- lwc_context_string_unref(
- ctx->sheets[0].sheet->dictionary,
- state.first_line);
+ lwc_string_unref(state.first_line);
if (state.first_letter != NULL)
- lwc_context_string_unref(
- ctx->sheets[0].sheet->dictionary,
- state.first_letter);
+ lwc_string_unref(state.first_letter);
if (state.before != NULL)
- lwc_context_string_unref(
- ctx->sheets[0].sheet->dictionary,
- state.before);
+ lwc_string_unref(state.before);
if (state.after != NULL)
- lwc_context_string_unref(
- ctx->sheets[0].sheet->dictionary,
- state.after);
+ lwc_string_unref(state.after);
}
return error;
}
@@ -574,73 +552,73 @@ css_error intern_strings_for_sheet(css_select_ctx *ctx,
lwc_error error;
UNUSED(ctx);
+ UNUSED(sheet);
/* Universal selector */
if (state->universal != NULL)
return CSS_OK;
- error = lwc_context_intern(sheet->dictionary,
- "*", SLEN("*"), &state->universal);
+ error = lwc_intern_string("*", SLEN("*"), &state->universal);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
/* Pseudo classes */
- error = lwc_context_intern(sheet->dictionary,
+ error = lwc_intern_string(
"first-child", SLEN("first-child"),
&state->first_child);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
- error = lwc_context_intern(sheet->dictionary,
+ error = lwc_intern_string(
"link", SLEN("link"),
&state->link);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
- error = lwc_context_intern(sheet->dictionary,
+ error = lwc_intern_string(
"visited", SLEN("visited"),
&state->visited);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
- error = lwc_context_intern(sheet->dictionary,
+ error = lwc_intern_string(
"hover", SLEN("hover"),
&state->hover);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
- error = lwc_context_intern(sheet->dictionary,
+ error = lwc_intern_string(
"active", SLEN("active"),
&state->active);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
- error = lwc_context_intern(sheet->dictionary,
+ error = lwc_intern_string(
"focus", SLEN("focus"),
&state->focus);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
/* Pseudo elements */
- error = lwc_context_intern(sheet->dictionary,
+ error = lwc_intern_string(
"first-line", SLEN("first-line"),
&state->first_line);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
- error = lwc_context_intern(sheet->dictionary,
+ error = lwc_intern_string(
"first_letter", SLEN("first-letter"),
&state->first_letter);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
- error = lwc_context_intern(sheet->dictionary,
+ error = lwc_intern_string(
"before", SLEN("before"),
&state->before);
if (error != lwc_error_ok)
return css_error_from_lwc_error(error);
- error = lwc_context_intern(sheet->dictionary,
+ error = lwc_intern_string(
"after", SLEN("after"),
&state->after);
if (error != lwc_error_ok)
@@ -742,13 +720,13 @@ css_error match_selectors_in_sheet(css_select_ctx *ctx,
/* Get node's name */
error = state->handler->node_name(state->pw, state->node,
- sheet->dictionary, &element);
+ &element);
if (error != CSS_OK)
return error;
/* Get node's ID, if any */
error = state->handler->node_id(state->pw, state->node,
- sheet->dictionary, &id);
+ &id);
if (error != CSS_OK)
goto cleanup;
@@ -757,7 +735,7 @@ css_error match_selectors_in_sheet(css_select_ctx *ctx,
* every time we call this? It seems hugely inefficient, given they can
* cache the data. */
error = state->handler->node_classes(state->pw, state->node,
- sheet->dictionary, &classes, &n_classes);
+ &classes, &n_classes);
if (error != CSS_OK)
goto cleanup;
@@ -870,15 +848,15 @@ cleanup:
if (classes != NULL) {
for (i = 0; i < n_classes; i++)
- lwc_context_string_unref(sheet->dictionary, classes[i]);
+ lwc_string_unref(classes[i]);
ctx->alloc(classes, 0, ctx->pw);
}
if (id != NULL)
- lwc_context_string_unref(sheet->dictionary, id);
+ lwc_string_unref(id);
- lwc_context_string_unref(sheet->dictionary, element);
+ lwc_string_unref(element);
return error;
}
diff --git a/src/stylesheet.c b/src/stylesheet.c
index a20ec14..9603b18 100644
--- a/src/stylesheet.c
+++ b/src/stylesheet.c
@@ -27,7 +27,6 @@ static size_t _rule_size(const css_rule *rule);
* \param title Title of stylesheet
* \param allow_quirks Permit quirky parsing of stylesheets
* \param inline_style This stylesheet is an inline style
- * \param dict Dictionary in which to intern strings
* \param alloc Memory (de)allocation function
* \param alloc_pw Client private data for alloc
* \param resolve URL resolution function
@@ -39,7 +38,7 @@ static size_t _rule_size(const css_rule *rule);
*/
css_error css_stylesheet_create(css_language_level level,
const char *charset, const char *url, const char *title,
- bool allow_quirks, bool inline_style, lwc_context *dict,
+ bool allow_quirks, bool inline_style,
css_allocator_fn alloc, void *alloc_pw,
css_url_resolution_fn resolve, void *resolve_pw,
css_stylesheet **stylesheet)
@@ -59,17 +58,16 @@ css_error css_stylesheet_create(css_language_level level,
memset(sheet, 0, sizeof(css_stylesheet));
- sheet->dictionary = dict;
sheet->inline_style = inline_style;
if (inline_style) {
error = css_parser_create_for_inline_style(charset,
charset ? CSS_CHARSET_DICTATED : CSS_CHARSET_DEFAULT,
- sheet->dictionary, alloc, alloc_pw, &sheet->parser);
+ alloc, alloc_pw, &sheet->parser);
} else {
error = css_parser_create(charset,
charset ? CSS_CHARSET_DICTATED : CSS_CHARSET_DEFAULT,
- sheet->dictionary, alloc, alloc_pw, &sheet->parser);
+ alloc, alloc_pw, &sheet->parser);
}
if (error != CSS_OK) {
@@ -99,7 +97,7 @@ css_error css_stylesheet_create(css_language_level level,
return error;
}
- error = css_selector_hash_create(dict, alloc, alloc_pw,
+ error = css_selector_hash_create(alloc, alloc_pw,
&sheet->selectors);
if (error != CSS_OK) {
css_language_destroy(sheet->parser_frontend);
@@ -322,8 +320,7 @@ css_error css_stylesheet_next_pending_import(css_stylesheet *parent,
break;
if (r->type == CSS_RULE_IMPORT && i->sheet == NULL) {
- *url = lwc_context_string_ref(parent->dictionary,
- i->url);
+ *url = lwc_string_ref(i->url);
*media = i->media;
return CSS_OK;
@@ -628,7 +625,7 @@ css_error css_stylesheet_selector_create(css_stylesheet *sheet,
memset(sel, 0, sizeof(css_selector));
sel->data.type = CSS_SELECTOR_ELEMENT;
- sel->data.name = lwc_context_string_ref(sheet->dictionary, name);
+ sel->data.name = lwc_string_ref(name);
sel->data.value = NULL;
if (sheet->inline_style) {
@@ -673,12 +670,10 @@ css_error css_stylesheet_selector_destroy(css_stylesheet *sheet,
d = c->combinator;
for (detail = &c->data; detail;) {
- lwc_context_string_unref(sheet->dictionary,
- detail->name);
+ lwc_string_unref(detail->name);
if (detail->value != NULL) {
- lwc_context_string_unref(sheet->dictionary,
- detail->value);
+ lwc_string_unref(detail->value);
}
if (detail->next)
@@ -691,11 +686,10 @@ css_error css_stylesheet_selector_destroy(css_stylesheet *sheet,
}
for (detail = &selector->data; detail;) {
- lwc_context_string_unref(sheet->dictionary, detail->name);
+ lwc_string_unref(detail->name);
if (detail->value != NULL) {
- lwc_context_string_unref(sheet->dictionary,
- detail->value);
+ lwc_string_unref(detail->value);
}
if (detail->next)
@@ -779,9 +773,9 @@ css_error css_stylesheet_selector_append_specific(css_stylesheet *sheet,
(&temp->data)[num_details].next = 1;
/* Ref the strings */
- lwc_context_string_ref(sheet->dictionary, detail->name);
+ lwc_string_ref(detail->name);
if (detail->value != NULL)
- lwc_context_string_ref(sheet->dictionary, detail->value);
+ lwc_string_ref(detail->value);
(*parent) = temp;
@@ -948,14 +942,14 @@ css_error css_stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule)
case CSS_RULE_CHARSET:
{
css_rule_charset *charset = (css_rule_charset *) rule;
- lwc_context_string_unref(sheet->dictionary, charset->encoding);
+ lwc_string_unref(charset->encoding);
}
break;
case CSS_RULE_IMPORT:
{
css_rule_import *import = (css_rule_import *) rule;
- lwc_context_string_unref(sheet->dictionary, import->url);
+ lwc_string_unref(import->url);
if (import->sheet != NULL)
css_stylesheet_destroy(import->sheet);
@@ -1137,7 +1131,7 @@ css_error css_stylesheet_rule_set_charset(css_stylesheet *sheet,
assert(rule->type == CSS_RULE_CHARSET);
/* Set rule's encoding field */
- r->encoding = lwc_context_string_ref(sheet->dictionary, charset);
+ r->encoding = lwc_string_ref(charset);
return CSS_OK;
}
@@ -1165,7 +1159,7 @@ css_error css_stylesheet_rule_set_nascent_import(css_stylesheet *sheet,
assert(rule->type == CSS_RULE_IMPORT);
/* Set the rule's sheet field */
- r->url = lwc_context_string_ref(sheet->dictionary, url);
+ r->url = lwc_string_ref(url);
r->media = media;
return CSS_OK;
diff --git a/src/stylesheet.h b/src/stylesheet.h
index 10a9827..8072686 100644
--- a/src/stylesheet.h
+++ b/src/stylesheet.h
@@ -164,8 +164,6 @@ struct css_stylesheet {
css_parser *parser; /**< Core parser for sheet */
void *parser_frontend; /**< Frontend parser */
- lwc_context *dictionary; /**< String dictionary */
-
bool quirks_allowed; /**< Quirks permitted */
bool quirks_used; /**< Quirks actually used */
diff --git a/src/utils/utils.h b/src/utils/utils.h
index 26c9a08..1fe2d46 100644
--- a/src/utils/utils.h
+++ b/src/utils/utils.h
@@ -70,6 +70,8 @@ css_error_from_lwc_error(lwc_error err)
return CSS_NOMEM;
case lwc_error_range:
return CSS_BADPARM;
+ default:
+ break;
}
return CSS_INVALID;
}
diff --git a/test/css21.c b/test/css21.c
index 5e6c71a..f969603 100644
--- a/test/css21.c
+++ b/test/css21.c
@@ -20,14 +20,14 @@ static void *myrealloc(void *ptr, size_t len, void *pw)
return realloc(ptr, len);
}
-static css_error resolve_url(void *pw, lwc_context *dict,
+static css_error resolve_url(void *pw,
const char *base, lwc_string *rel, lwc_string **abs)
{
UNUSED(pw);
UNUSED(base);
/* About as useless as possible */
- *abs = lwc_context_string_ref(dict, rel);
+ *abs = lwc_string_ref(rel);
return CSS_OK;
}
@@ -40,7 +40,6 @@ int main(int argc, char **argv)
#define CHUNK_SIZE (4096)
uint8_t buf[CHUNK_SIZE];
css_error error;
- lwc_context *ctx;
int count;
if (argc != 3) {
@@ -51,14 +50,12 @@ int main(int argc, char **argv)
/* Initialise library */
assert(css_initialise(argv[1], myrealloc, NULL) == CSS_OK);
- assert(lwc_create_context(myrealloc, NULL, &ctx) == lwc_error_ok);
-
- lwc_context_ref(ctx); /* Transform weak ref to a strong ref */
+ assert(lwc_initialise(myrealloc, NULL, 0) == lwc_error_ok);
for (count = 0; count < ITERATIONS; count++) {
assert(css_stylesheet_create(CSS_LEVEL_21, "UTF-8", argv[2],
- NULL, false, false, ctx, myrealloc, NULL,
+ NULL, false, false, myrealloc, NULL,
resolve_url, NULL, &sheet) == CSS_OK);
fp = fopen(argv[2], "rb");
@@ -114,7 +111,7 @@ int main(int argc, char **argv)
buf[lwc_string_length(url)] = '\0';
assert(css_stylesheet_create(CSS_LEVEL_21,
- "UTF-8", buf, NULL, false, false, ctx,
+ "UTF-8", buf, NULL, false, false,
myrealloc, NULL, resolve_url, NULL,
&import) == CSS_OK);
@@ -153,8 +150,6 @@ int main(int argc, char **argv)
printf("PASS\n");
- lwc_context_unref(ctx);
-
return 0;
}
diff --git a/test/number.c b/test/number.c
index 7bb57c3..ca9ddb5 100644
--- a/test/number.c
+++ b/test/number.c
@@ -58,6 +58,8 @@ int main(int argc, char **argv)
ctx.indata = false;
ctx.inexp = false;
+ assert(lwc_initialise(myrealloc, NULL, 0) == lwc_error_ok);
+
assert(parse_testfile(argv[2], handle_line, &ctx) == true);
/* and run final test */
@@ -118,7 +120,6 @@ bool handle_line(const char *data, size_t datalen, void *pw)
void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen)
{
lwc_string *in;
- lwc_context *ctx;
size_t consumed;
css_fixed result;
char buf[256];
@@ -126,9 +127,7 @@ void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen)
UNUSED(exp);
UNUSED(explen);
- assert(lwc_create_context(myrealloc, NULL, &ctx) == lwc_error_ok);
- lwc_context_ref(ctx);
- assert(lwc_context_intern(ctx, (const char *)data, len, &in) == lwc_error_ok);
+ assert(lwc_intern_string((const char *)data, len, &in) == lwc_error_ok);
result = number_from_lwc_string(in, false, &consumed);
@@ -137,7 +136,6 @@ void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen)
printf("got: %s expected: %.*s\n", buf, (int) explen, exp);
assert(strncmp(buf, exp, explen) == 0);
- lwc_context_unref(ctx);
}
void print_css_fixed(char *buf, size_t len, css_fixed f)
diff --git a/test/parse-auto.c b/test/parse-auto.c
index 070f8db..12cdae7 100644
--- a/test/parse-auto.c
+++ b/test/parse-auto.c
@@ -68,14 +68,14 @@ static void *myrealloc(void *data, size_t len, void *pw)
return realloc(data, len);
}
-static css_error resolve_url(void *pw, lwc_context *dict,
+static css_error resolve_url(void *pw,
const char *base, lwc_string *rel, lwc_string **abs)
{
UNUSED(pw);
UNUSED(base);
/* About as useless as possible */
- *abs = lwc_context_string_ref(dict, rel);
+ *abs = lwc_string_ref(rel);
return CSS_OK;
}
@@ -111,6 +111,8 @@ int main(int argc, char **argv)
ctx.inerrors = false;
ctx.inexp = false;
+ assert(lwc_initialise(myrealloc, NULL, 0) == lwc_error_ok);
+
assert(parse_testfile(argv[2], handle_line, &ctx) == true);
/* and run final test */
@@ -318,13 +320,9 @@ void run_test(const uint8_t *data, size_t len, exp_entry *exp, size_t explen)
css_error error;
size_t e;
static int testnum;
- lwc_context *ctx;
-
- assert(lwc_create_context(myrealloc, NULL, &ctx) == lwc_error_ok);
- lwc_context_ref(ctx);
assert(css_stylesheet_create(CSS_LEVEL_21, "UTF-8", "foo", NULL,
- false, false, ctx, myrealloc, NULL, resolve_url, NULL,
+ false, false, myrealloc, NULL, resolve_url, NULL,
&sheet) == CSS_OK);
error = css_stylesheet_append_data(sheet, data, len);
@@ -353,7 +351,7 @@ void run_test(const uint8_t *data, size_t len, exp_entry *exp, size_t explen)
buf[lwc_string_length(url)] = '\0';
assert(css_stylesheet_create(CSS_LEVEL_21,
- "UTF-8", buf, NULL, false, false, ctx,
+ "UTF-8", buf, NULL, false, false,
myrealloc, NULL, resolve_url, NULL,
&import) == CSS_OK);
@@ -405,7 +403,6 @@ void run_test(const uint8_t *data, size_t len, exp_entry *exp, size_t explen)
css_stylesheet_destroy(sheet);
printf("Test %d: PASS\n", testnum);
- lwc_context_unref(ctx);
}
void validate_rule_selector(css_rule_selector *s, exp_entry *e, int testnum)
diff --git a/test/parse.c b/test/parse.c
index ec17001..3618f34 100644
--- a/test/parse.c
+++ b/test/parse.c
@@ -82,7 +82,6 @@ int main(int argc, char **argv)
#define CHUNK_SIZE (4096)
uint8_t buf[CHUNK_SIZE];
css_error error;
- lwc_context *ctx;
int i;
if (argc != 3) {
@@ -92,11 +91,10 @@ int main(int argc, char **argv)
/* Initialise library */
assert(css_initialise(argv[1], myrealloc, NULL) == CSS_OK);
- assert(lwc_create_context(myrealloc, NULL, &ctx) == lwc_error_ok);
- lwc_context_ref(ctx);
+ assert(lwc_initialise(myrealloc, NULL, 0) == lwc_error_ok);
for (i = 0; i < ITERATIONS; i++) {
- assert(css_parser_create("UTF-8", CSS_CHARSET_DICTATED, ctx,
+ assert(css_parser_create("UTF-8", CSS_CHARSET_DICTATED,
myrealloc, NULL, &parser) == CSS_OK);
params.event_handler.handler = event_handler;
@@ -146,8 +144,6 @@ int main(int argc, char **argv)
printf("PASS\n");
- lwc_context_unref(ctx);
-
return 0;
}
diff --git a/test/parse2-auto.c b/test/parse2-auto.c
index 2a89ef4..c9f37ab 100644
--- a/test/parse2-auto.c
+++ b/test/parse2-auto.c
@@ -41,14 +41,14 @@ static void *myrealloc(void *data, size_t len, void *pw)
return realloc(data, len);
}
-static css_error resolve_url(void *pw, lwc_context *dict,
+static css_error resolve_url(void *pw,
const char *base, lwc_string *rel, lwc_string **abs)
{
UNUSED(pw);
UNUSED(base);
/* About as useless as possible */
- *abs = lwc_context_string_ref(dict, rel);
+ *abs = lwc_string_ref(rel);
return CSS_OK;
}
@@ -84,6 +84,8 @@ int main(int argc, char **argv)
ctx.inerrors = false;
ctx.inexp = false;
+ assert(lwc_initialise(myrealloc, NULL, 0) == lwc_error_ok);
+
assert(parse_testfile(argv[2], handle_line, &ctx) == true);
/* and run final test */
@@ -176,7 +178,6 @@ void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen)
char *buf;
size_t buflen;
static int testnum;
- lwc_context *ctx;
buf = malloc(2 * explen);
if (buf == NULL) {
@@ -184,11 +185,8 @@ void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen)
}
buflen = 2 * explen;
- assert(lwc_create_context(myrealloc, NULL, &ctx) == lwc_error_ok);
- lwc_context_ref(ctx);
-
assert(css_stylesheet_create(CSS_LEVEL_21, "UTF-8", "foo", NULL,
- false, false, ctx, myrealloc, NULL, resolve_url, NULL,
+ false, false, myrealloc, NULL, resolve_url, NULL,
&sheet) == CSS_OK);
error = css_stylesheet_append_data(sheet, data, len);
@@ -212,7 +210,7 @@ void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen)
}
css_stylesheet_destroy(sheet);
- lwc_context_unref(ctx);
+
printf("Test %d: PASS\n", testnum);
}
diff --git a/test/select-auto.c b/test/select-auto.c
index b0d2594..72a8a75 100644
--- a/test/select-auto.c
+++ b/test/select-auto.c
@@ -60,7 +60,6 @@ typedef struct line_ctx {
uint32_t pseudo_element;
node *target;
- lwc_context *dict;
lwc_string *attr_class;
lwc_string *attr_id;
} line_ctx;
@@ -76,11 +75,11 @@ static void parse_expected(line_ctx *ctx, const char *data, size_t len);
static void run_test(line_ctx *ctx, const char *exp, size_t explen);
static void destroy_tree(node *root);
-static css_error node_name(void *pw, void *node, lwc_context *ctx,
+static css_error node_name(void *pw, void *node,
lwc_string **name);
-static css_error node_classes(void *pw, void *node, lwc_context *ctx,
+static css_error node_classes(void *pw, void *node,
lwc_string ***classes, uint32_t *n_classes);
-static css_error node_id(void *pw, void *node, lwc_context *ctx,
+static css_error node_id(void *pw, void *node,
lwc_string **id);
static css_error named_ancestor_node(void *pw, void *node,
lwc_string *name,
@@ -167,14 +166,14 @@ static void *myrealloc(void *data, size_t len, void *pw)
return realloc(data, len);
}
-static css_error resolve_url(void *pw, lwc_context *dict,
+static css_error resolve_url(void *pw,
const char *base, lwc_string *rel, lwc_string **abs)
{
UNUSED(pw);
UNUSED(base);
/* About as useless as possible */
- *abs = lwc_context_string_ref(dict, rel);
+ *abs = lwc_string_ref(rel);
return CSS_OK;
}
@@ -195,11 +194,11 @@ int main(int argc, char **argv)
memset(&ctx, 0, sizeof(ctx));
- assert(lwc_create_context(myrealloc, NULL, &ctx.dict) == lwc_error_ok);
- lwc_context_ref(ctx.dict);
+ assert(lwc_initialise(myrealloc, NULL, 0) == lwc_error_ok);
- lwc_context_intern(ctx.dict, "class", SLEN("class"), &ctx.attr_class);
- lwc_context_intern(ctx.dict, "id", SLEN("id"), &ctx.attr_id);
+
+ lwc_intern_string("class", SLEN("class"), &ctx.attr_class);
+ lwc_intern_string("id", SLEN("id"), &ctx.attr_id);
assert(parse_testfile(argv[2], handle_line, &ctx) == true);
@@ -211,8 +210,6 @@ int main(int argc, char **argv)
assert(css_finalise(myrealloc, NULL) == CSS_OK);
- lwc_context_unref(ctx.dict);
-
printf("PASS\n");
return 0;
}
@@ -393,7 +390,7 @@ void parse_tree_data(line_ctx *ctx, const char *data, size_t len)
memset(n, 0, sizeof(node));
- lwc_context_intern(ctx->dict, name, namelen, &n->name);
+ lwc_intern_string(name, namelen, &n->name);
/* Insert it into tree */
if (ctx->tree == NULL) {
@@ -439,8 +436,8 @@ void parse_tree_data(line_ctx *ctx, const char *data, size_t len)
attr = &ctx->current->attrs[ctx->current->n_attrs];
- lwc_context_intern(ctx->dict, name, namelen, &attr->name);
- lwc_context_intern(ctx->dict, value, valuelen, &attr->value);
+ lwc_intern_string(name, namelen, &attr->name);
+ lwc_intern_string(value, valuelen, &attr->value);
ctx->current->n_attrs++;
}
@@ -484,7 +481,7 @@ void parse_sheet(line_ctx *ctx, const char *data, size_t len)
/** \todo How are we going to handle @import? */
assert(css_stylesheet_create(CSS_LEVEL_21, "UTF-8", "foo", "foo",
- false, false, ctx->dict, myrealloc, NULL,
+ false, false, myrealloc, NULL,
resolve_url, NULL, &sheet) == CSS_OK);
/* Extend array of sheets and append new sheet to it */
@@ -725,18 +722,18 @@ void destroy_tree(node *root)
}
-css_error node_name(void *pw, void *n, lwc_context *ctx, lwc_string **name)
+css_error node_name(void *pw, void *n, lwc_string **name)
{
node *node = n;
UNUSED(pw);
- *name = lwc_context_string_ref(ctx, node->name);
+ *name = lwc_string_ref(node->name);
return CSS_OK;
}
-css_error node_classes(void *pw, void *n, lwc_context *ctx,
+css_error node_classes(void *pw, void *n,
lwc_string ***classes, uint32_t *n_classes)
{
node *node = n;
@@ -745,7 +742,7 @@ css_error node_classes(void *pw, void *n, lwc_context *ctx,
for (i = 0; i < node->n_attrs; i++) {
bool amatch;
- assert(lwc_context_string_caseless_isequal(ctx,
+ assert(lwc_string_caseless_isequal(
node->attrs[i].name, lc->attr_class, &amatch) ==
lwc_error_ok);
if (amatch == true)
@@ -758,7 +755,7 @@ css_error node_classes(void *pw, void *n, lwc_context *ctx,
return CSS_NOMEM;
*(classes[0]) =
- lwc_context_string_ref(ctx, node->attrs[i].value);
+ lwc_string_ref(node->attrs[i].value);
*n_classes = 1;
} else {
*classes = NULL;
@@ -769,7 +766,7 @@ css_error node_classes(void *pw, void *n, lwc_context *ctx,
}
-css_error node_id(void *pw, void *n, lwc_context *ctx,
+css_error node_id(void *pw, void *n,
lwc_string **id)
{
node *node = n;
@@ -778,7 +775,7 @@ css_error node_id(void *pw, void *n, lwc_context *ctx,
for (i = 0; i < node->n_attrs; i++) {
bool amatch;
- assert(lwc_context_string_caseless_isequal(ctx,
+ assert(lwc_string_caseless_isequal(
node->attrs[i].name, lc->attr_id, &amatch) ==
lwc_error_ok);
if (amatch == true)
@@ -786,7 +783,7 @@ css_error node_id(void *pw, void *n, lwc_context *ctx,
}
if (i != node->n_attrs)
- *id = lwc_context_string_ref(ctx, node->attrs[i].value);
+ *id = lwc_string_ref(node->attrs[i].value);
else
*id = NULL;
@@ -798,11 +795,11 @@ css_error named_ancestor_node(void *pw, void *n,
void **ancestor)
{
node *node = n;
- line_ctx *ctx = pw;
+ UNUSED(pw);
for (node = node->parent; node != NULL; node = node->parent) {
bool match;
- assert(lwc_context_string_caseless_isequal(ctx->dict,
+ assert(lwc_string_caseless_isequal(
name, node->name, &match) == lwc_error_ok);
if (match == true)
break;
@@ -818,12 +815,12 @@ css_error named_parent_node(void *pw, void *n,
void **parent)
{
node *node = n;
- line_ctx *ctx = pw;
+ UNUSED(pw);
*parent = NULL;
if (node->parent != NULL) {
bool match;
- assert(lwc_context_string_caseless_isequal(ctx->dict,
+ assert(lwc_string_caseless_isequal(
name, node->parent->name, &match) ==
lwc_error_ok);
if (match == true)
@@ -838,12 +835,12 @@ css_error named_sibling_node(void *pw, void *n,
void **sibling)
{
node *node = n;
- line_ctx *ctx = pw;
+ UNUSED(pw);
*sibling = NULL;
if (node->prev != NULL) {
bool match;
- assert(lwc_context_string_caseless_isequal(ctx->dict,
+ assert(lwc_string_caseless_isequal(
name, node->prev->name, &match) ==
lwc_error_ok);
if (match == true)
@@ -880,9 +877,9 @@ css_error node_has_name(void *pw, void *n,
bool *match)
{
node *node = n;
- line_ctx *ctx = pw;
+ UNUSED(pw);
- assert(lwc_context_string_caseless_isequal(ctx->dict, node->name,
+ assert(lwc_string_caseless_isequal(node->name,
name, match) == lwc_error_ok);
return CSS_OK;
@@ -898,7 +895,7 @@ css_error node_has_class(void *pw, void *n,
for (i = 0; i < node->n_attrs; i++) {
bool amatch;
- assert(lwc_context_string_caseless_isequal(ctx->dict,
+ assert(lwc_string_caseless_isequal(
node->attrs[i].name, ctx->attr_class,
&amatch) == lwc_error_ok);
if (amatch == true)
@@ -924,7 +921,7 @@ css_error node_has_id(void *pw, void *n,
for (i = 0; i < node->n_attrs; i++) {
bool amatch;
- assert(lwc_context_string_caseless_isequal(ctx->dict,
+ assert(lwc_string_caseless_isequal(
node->attrs[i].name, ctx->attr_id, &amatch) ==
lwc_error_ok);
if (amatch == true)
@@ -946,11 +943,11 @@ css_error node_has_attribute(void *pw, void *n,
{
node *node = n;
uint32_t i;
- line_ctx *ctx = pw;
+ UNUSED(pw);
*match = false;
for (i = 0; i < node->n_attrs; i++) {
- assert(lwc_context_string_caseless_isequal(ctx->dict,
+ assert(lwc_string_caseless_isequal(
node->attrs[i].name, name, match) ==
lwc_error_ok);
if (*match == true)
@@ -967,12 +964,12 @@ css_error node_has_attribute_equal(void *pw, void *n,
{
node *node = n;
uint32_t i;
- line_ctx *ctx = pw;
+ UNUSED(pw);
*match = false;
for (i = 0; i < node->n_attrs; i++) {
- assert(lwc_context_string_caseless_isequal(ctx->dict,
+ assert(lwc_string_caseless_isequal(
node->attrs[i].name, name, match) ==
lwc_error_ok);
if (*match == true)
@@ -980,7 +977,7 @@ css_error node_has_attribute_equal(void *pw, void *n,
}
if (*match == true) {
- assert(lwc_context_string_caseless_isequal(ctx->dict,
+ assert(lwc_string_caseless_isequal(
node->attrs[i].name, value, match) ==
lwc_error_ok);
}
@@ -995,13 +992,13 @@ css_error node_has_attribute_includes(void *pw, void *n,
{
node *node = n;
uint32_t i;
- line_ctx *ctx = pw;
size_t vlen = lwc_string_length(value);
+ UNUSED(pw);
*match = false;
for (i = 0; i < node->n_attrs; i++) {
- assert(lwc_context_string_caseless_isequal(ctx->dict,
+ assert(lwc_string_caseless_isequal(
node->attrs[i].name, name, match) ==
lwc_error_ok);
if (*match == true)
@@ -1041,13 +1038,13 @@ css_error node_has_attribute_dashmatch(void *pw, void *n,
{
node *node = n;
uint32_t i;
- line_ctx *ctx = pw;
size_t vlen = lwc_string_length(value);
+ UNUSED(pw);
*match = false;
for (i = 0; i < node->n_attrs; i++) {
- assert(lwc_context_string_caseless_isequal(ctx->dict,
+ assert(lwc_string_caseless_isequal(
node->attrs[i].name, name, match) ==
lwc_error_ok);
if (*match == true)