summaryrefslogtreecommitdiff
path: root/src/parse/properties/margin.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-07-27 12:17:51 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-07-27 12:17:51 +0000
commitc1a3d0bb1b2fd93dd6b6d6b94e7897da01bd9083 (patch)
treef9e177429a1112f1672c74f07ebfc3e0e9cb60b8 /src/parse/properties/margin.c
parente20927d57c447c7b74af4f00f1ecbd19b554ab65 (diff)
downloadlibcss-c1a3d0bb1b2fd93dd6b6d6b94e7897da01bd9083.tar.gz
libcss-c1a3d0bb1b2fd93dd6b6d6b94e7897da01bd9083.tar.bz2
Don't intern lower-case versions of strings. Use lwc_context_string_caseless_isequal, instead.
svn path=/trunk/libcss/; revision=8815
Diffstat (limited to 'src/parse/properties/margin.c')
-rw-r--r--src/parse/properties/margin.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/parse/properties/margin.c b/src/parse/properties/margin.c
index 3479abf..a0aa6b9 100644
--- a/src/parse/properties/margin.c
+++ b/src/parse/properties/margin.c
@@ -45,12 +45,16 @@ css_error parse_margin(css_language *c,
css_style *ret = NULL;
uint32_t num_sides = 0;
uint32_t required_size;
+ bool match;
css_error error;
/* Firstly, handle inherit */
token = parserutils_vector_peek(vector, *ctx);
if (token != NULL && token->type == CSS_TOKEN_IDENT &&
- token->ilower == c->strings[INHERIT]) {
+ (lwc_context_string_caseless_isequal(
+ c->sheet->dictionary,
+ token->idata, c->strings[INHERIT],
+ &match) == lwc_error_ok && match)) {
uint32_t *bytecode;
error = css_stylesheet_style_create(c->sheet,
@@ -90,7 +94,10 @@ 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 &&
- token->ilower == c->strings[INHERIT]) {
+ (lwc_context_string_caseless_isequal(
+ c->sheet->dictionary,
+ token->idata, c->strings[INHERIT],
+ &match) == lwc_error_ok && match)) {
error = CSS_INVALID;
goto cleanup;
}
@@ -372,6 +379,7 @@ css_error parse_margin_side(css_language *c,
css_fixed length = 0;
uint32_t unit = 0;
uint32_t required_size;
+ bool match;
/* length | percentage | IDENT(auto, inherit) */
token = parserutils_vector_peek(vector, *ctx);
@@ -381,11 +389,17 @@ css_error parse_margin_side(css_language *c,
}
if (token->type == CSS_TOKEN_IDENT &&
- token->ilower == c->strings[INHERIT]) {
+ (lwc_context_string_caseless_isequal(
+ c->sheet->dictionary,
+ 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 &&
- token->ilower == c->strings[AUTO]) {
+ (lwc_context_string_caseless_isequal(
+ c->sheet->dictionary,
+ token->idata, c->strings[AUTO],
+ &match) == lwc_error_ok && match)) {
parserutils_vector_iterate(vector, ctx);
value = MARGIN_AUTO;
} else {