summaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-01-16 21:41:33 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-01-16 21:41:33 +0000
commitf375b6403aad42c79fbaaab911de311a192f5d2b (patch)
treed77094202fedfa5f44fb2d24b7c86e0fd288205b /src/parse
parentabfd1c31876aaa97090bf8e21ac4e146751a8adb (diff)
downloadlibcss-f375b6403aad42c79fbaaab911de311a192f5d2b.tar.gz
libcss-f375b6403aad42c79fbaaab911de311a192f5d2b.tar.bz2
Fix counter-increment and counter-reset
svn path=/trunk/libcss/; revision=6098
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/properties.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/parse/properties.c b/src/parse/properties.c
index a0da94f..a4237a3 100644
--- a/src/parse/properties.c
+++ b/src/parse/properties.c
@@ -1608,7 +1608,7 @@ css_error parse_counter_increment(css_language *c,
int temp_ctx = *ctx;
uint8_t *ptr;
- /* [IDENT <integer> ]+ | IDENT(none, inherit) */
+ /* [IDENT <integer>? ]+ | IDENT(none, inherit) */
/* Pass 1: validate input and calculate bytecode size */
token = parserutils_vector_iterate(vector, &temp_ctx);
@@ -1626,17 +1626,17 @@ css_error parse_counter_increment(css_language *c,
while (token != NULL) {
const parserutils_hash_entry *name = token->idata;
- fixed increment = 1;
+ fixed increment = INTTOFIX(1);
consumeWhitespace(vector, &temp_ctx);
/* Optional integer */
token = parserutils_vector_peek(vector, temp_ctx);
- if (token == NULL || (token->type != CSS_TOKEN_IDENT &&
- token->type != CSS_TOKEN_NUMBER))
+ if (token != NULL && token->type != CSS_TOKEN_IDENT &&
+ token->type != CSS_TOKEN_NUMBER)
return CSS_INVALID;
- if (token->type == CSS_TOKEN_NUMBER) {
+ if (token != NULL && token->type == CSS_TOKEN_NUMBER) {
const css_string temp = { token->ilower->len,
(uint8_t *) token->ilower->data };
size_t consumed = 0;
@@ -1658,7 +1658,7 @@ css_error parse_counter_increment(css_language *c,
required_size += sizeof(name) + sizeof(increment);
token = parserutils_vector_peek(vector, temp_ctx);
- if (token != NULL && tokenIsChar(token, '!')) {
+ if (token == NULL || tokenIsChar(token, '!')) {
break;
}
@@ -1702,17 +1702,17 @@ css_error parse_counter_increment(css_language *c,
while (token != NULL) {
const parserutils_hash_entry *name = token->idata;
- fixed increment = 1;
+ fixed increment = INTTOFIX(1);
consumeWhitespace(vector, ctx);
/* Optional integer */
token = parserutils_vector_peek(vector, *ctx);
- if (token == NULL || (token->type != CSS_TOKEN_IDENT &&
- token->type != CSS_TOKEN_NUMBER))
+ if (token != NULL && token->type != CSS_TOKEN_IDENT &&
+ token->type != CSS_TOKEN_NUMBER)
return CSS_INVALID;
- if (token->type == CSS_TOKEN_NUMBER) {
+ if (token != NULL && token->type == CSS_TOKEN_NUMBER) {
const css_string temp = { token->ilower->len,
(uint8_t *) token->ilower->data };
size_t consumed = 0;
@@ -1738,7 +1738,7 @@ css_error parse_counter_increment(css_language *c,
ptr += sizeof(increment);
token = parserutils_vector_peek(vector, *ctx);
- if (token != NULL && tokenIsChar(token, '!')) {
+ if (token == NULL || tokenIsChar(token, '!')) {
break;
}
@@ -1773,7 +1773,7 @@ css_error parse_counter_reset(css_language *c,
int temp_ctx = *ctx;
uint8_t *ptr;
- /* [IDENT <integer> ]+ | IDENT(none, inherit) */
+ /* [IDENT <integer>? ]+ | IDENT(none, inherit) */
/* Pass 1: validate input and calculate bytecode size */
token = parserutils_vector_iterate(vector, &temp_ctx);
@@ -1791,17 +1791,17 @@ css_error parse_counter_reset(css_language *c,
while (token != NULL) {
const parserutils_hash_entry *name = token->idata;
- fixed increment = 1;
+ fixed increment = INTTOFIX(1);
consumeWhitespace(vector, &temp_ctx);
/* Optional integer */
token = parserutils_vector_peek(vector, temp_ctx);
- if (token == NULL || (token->type != CSS_TOKEN_IDENT &&
- token->type != CSS_TOKEN_NUMBER))
+ if (token != NULL && token->type != CSS_TOKEN_IDENT &&
+ token->type != CSS_TOKEN_NUMBER)
return CSS_INVALID;
- if (token->type == CSS_TOKEN_NUMBER) {
+ if (token != NULL && token->type == CSS_TOKEN_NUMBER) {
const css_string temp = { token->ilower->len,
(uint8_t *) token->ilower->data };
size_t consumed = 0;
@@ -1823,7 +1823,7 @@ css_error parse_counter_reset(css_language *c,
required_size += sizeof(name) + sizeof(increment);
token = parserutils_vector_peek(vector, temp_ctx);
- if (token != NULL && tokenIsChar(token, '!')) {
+ if (token == NULL || tokenIsChar(token, '!')) {
break;
}
@@ -1867,17 +1867,17 @@ css_error parse_counter_reset(css_language *c,
while (token != NULL) {
const parserutils_hash_entry *name = token->idata;
- fixed increment = 1;
+ fixed increment = INTTOFIX(1);
consumeWhitespace(vector, ctx);
/* Optional integer */
token = parserutils_vector_peek(vector, *ctx);
- if (token == NULL || (token->type != CSS_TOKEN_IDENT &&
- token->type != CSS_TOKEN_NUMBER))
+ if (token != NULL && token->type != CSS_TOKEN_IDENT &&
+ token->type != CSS_TOKEN_NUMBER)
return CSS_INVALID;
- if (token->type == CSS_TOKEN_NUMBER) {
+ if (token != NULL && token->type == CSS_TOKEN_NUMBER) {
const css_string temp = { token->ilower->len,
(uint8_t *) token->ilower->data };
size_t consumed = 0;
@@ -1903,7 +1903,7 @@ css_error parse_counter_reset(css_language *c,
ptr += sizeof(increment);
token = parserutils_vector_peek(vector, *ctx);
- if (token != NULL && tokenIsChar(token, '!')) {
+ if (token == NULL || tokenIsChar(token, '!')) {
break;
}