diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-05-27 00:16:03 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-05-27 00:16:03 +0000 |
commit | bbe40f6f982426cd6ab40b30dd0d413ab5249aed (patch) | |
tree | 993dd64d68f962465ba940f3d998dd581d2953f2 /src/parse/properties/properties.c | |
parent | 5f47593e78ab1fb0d0adf24c6cfa1fbae0a36e1a (diff) | |
download | libcss-bbe40f6f982426cd6ab40b30dd0d413ab5249aed.tar.gz libcss-bbe40f6f982426cd6ab40b30dd0d413ab5249aed.tar.bz2 |
Quotes property is also generated content, so move to appropriate file
svn path=/trunk/libcss/; revision=7565
Diffstat (limited to 'src/parse/properties/properties.c')
-rw-r--r-- | src/parse/properties/properties.c | 158 |
1 files changed, 0 insertions, 158 deletions
diff --git a/src/parse/properties/properties.c b/src/parse/properties/properties.c index 345377c..ccb2b64 100644 --- a/src/parse/properties/properties.c +++ b/src/parse/properties/properties.c @@ -1379,164 +1379,6 @@ css_error parse_overflow(css_language *c, return CSS_OK; } -css_error parse_quotes(css_language *c, - const parserutils_vector *vector, int *ctx, - css_style **result) -{ - css_error error; - const css_token *token; - uint8_t flags = 0; - uint16_t value = 0; - uint32_t opv; - uint32_t required_size = sizeof(opv); - int temp_ctx = *ctx; - uint8_t *ptr; - - /* [ STRING STRING ]+ | IDENT(none,inherit) */ - - /* Pass 1: validate input and calculate bytecode size */ - token = parserutils_vector_iterate(vector, &temp_ctx); - if (token == NULL || (token->type != CSS_TOKEN_IDENT && - token->type != CSS_TOKEN_STRING)) - return CSS_INVALID; - - if (token->type == CSS_TOKEN_IDENT) { - if (token->ilower == c->strings[INHERIT]) { - flags = FLAG_INHERIT; - } else if (token->ilower == c->strings[NONE]) { - value = QUOTES_NONE; - } else - return CSS_INVALID; - } else { - bool first = true; - - /* [ STRING STRING ] + */ - while (token != NULL && token->type == CSS_TOKEN_STRING) { - lwc_string *open = token->idata; - lwc_string *close; - - consumeWhitespace(vector, &temp_ctx); - - token = parserutils_vector_peek(vector, temp_ctx); - if (token == NULL || token->type != CSS_TOKEN_STRING) - return CSS_INVALID; - - close = token->idata; - - token = parserutils_vector_iterate(vector, &temp_ctx); - - consumeWhitespace(vector, &temp_ctx); - - if (first == false) { - required_size += sizeof(opv); - } else { - value = QUOTES_STRING; - } - required_size += sizeof(open) + sizeof(close); - - first = false; - - token = parserutils_vector_peek(vector, temp_ctx); - if (token == NULL || token->type != CSS_TOKEN_STRING) - break; - token = parserutils_vector_iterate(vector, &temp_ctx); - } - - consumeWhitespace(vector, &temp_ctx); - - token = parserutils_vector_peek(vector, temp_ctx); - if (token != NULL && tokenIsChar(token, '!') == false) - return CSS_INVALID; - - /* Terminator */ - required_size += sizeof(opv); - } - - error = parse_important(c, vector, &temp_ctx, &flags); - if (error != CSS_OK) - return error; - - opv = buildOPV(CSS_PROP_QUOTES, flags, value); - - /* Allocate result */ - error = css_stylesheet_style_create(c->sheet, required_size, result); - if (error != CSS_OK) - return error; - - /* Copy OPV to bytecode */ - ptr = (*result)->bytecode; - memcpy(ptr, &opv, sizeof(opv)); - ptr += sizeof(opv); - - /* Pass 2: construct bytecode */ - token = parserutils_vector_iterate(vector, ctx); - if (token == NULL || (token->type != CSS_TOKEN_IDENT && - token->type != CSS_TOKEN_STRING)) - return CSS_INVALID; - - if (token->type == CSS_TOKEN_IDENT) { - /* Nothing to do */ - } else { - bool first = true; - - /* [ STRING STRING ]+ */ - while (token != NULL && token->type == CSS_TOKEN_STRING) { - lwc_string *open = token->idata; - lwc_string *close; - - consumeWhitespace(vector, ctx); - - token = parserutils_vector_peek(vector, *ctx); - if (token == NULL || token->type != CSS_TOKEN_STRING) - return CSS_INVALID; - - close = token->idata; - - token = parserutils_vector_iterate(vector, ctx); - - consumeWhitespace(vector, ctx); - - if (first == false) { - opv = QUOTES_STRING; - memcpy(ptr, &opv, sizeof(opv)); - ptr += sizeof(opv); - } - - lwc_context_string_ref(c->sheet->dictionary, open); - memcpy(ptr, &open, sizeof(open)); - ptr += sizeof(open); - - lwc_context_string_ref(c->sheet->dictionary, close); - memcpy(ptr, &close, sizeof(close)); - ptr += sizeof(close); - - first = false; - - token = parserutils_vector_peek(vector, *ctx); - if (token == NULL || token->type != CSS_TOKEN_STRING) - break; - token = parserutils_vector_iterate(vector, ctx); - } - - consumeWhitespace(vector, ctx); - - token = parserutils_vector_peek(vector, *ctx); - if (token != NULL && tokenIsChar(token, '!') == false) - return CSS_INVALID; - - /* Terminator */ - opv = QUOTES_NONE; - memcpy(ptr, &opv, sizeof(opv)); - ptr += sizeof(opv); - } - - error = parse_important(c, vector, ctx, &flags); - if (error != CSS_OK) - return error; - - return CSS_OK; -} - css_error parse_table_layout(css_language *c, const parserutils_vector *vector, int *ctx, css_style **result) |