summaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-01-16 23:12:43 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-01-16 23:12:43 +0000
commit842eb4a0e4b93dc0dd28cfc4553918a3f4d62ed7 (patch)
tree156438b1454904fab8260294e384eb41d82ab089 /src/parse
parent0acf290768db5d13da5c36adb105303f5bae7502 (diff)
downloadlibcss-842eb4a0e4b93dc0dd28cfc4553918a3f4d62ed7.tar.gz
libcss-842eb4a0e4b93dc0dd28cfc4553918a3f4d62ed7.tar.bz2
Fix cursor: parsing
svn path=/trunk/libcss/; revision=6104
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/properties.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/parse/properties.c b/src/parse/properties.c
index a4237a3..4cd3eaa 100644
--- a/src/parse/properties.c
+++ b/src/parse/properties.c
@@ -2046,7 +2046,7 @@ css_error parse_cursor(css_language *c,
int temp_ctx = *ctx;
uint8_t *ptr;
- /* [ URI* IDENT(auto, crosshair, default, pointer, move, e-resize,
+ /* [ (URI ',')* IDENT(auto, crosshair, default, pointer, move, e-resize,
* ne-resize, nw-resize, n-resize, se-resize, sw-resize,
* s-resize, w-resize, text, wait, help, progress) ]
* | IDENT(inherit)
@@ -2077,14 +2077,20 @@ css_error parse_cursor(css_language *c,
consumeWhitespace(vector, &temp_ctx);
- token = parserutils_vector_peek(vector, temp_ctx);
- if (token != NULL && tokenIsChar(token, '!')) {
- break;
- }
+ /* Expect ',' */
+ token = parserutils_vector_iterate(vector, &temp_ctx);
+ if (token == NULL || tokenIsChar(token, ',') == false)
+ return CSS_INVALID;
- first = false;
+ consumeWhitespace(vector, &temp_ctx);
+ /* Expect either URI or IDENT */
token = parserutils_vector_iterate(vector, &temp_ctx);
+ if (token == NULL || (token->type != CSS_TOKEN_IDENT &&
+ token->type != CSS_TOKEN_URI))
+ return CSS_INVALID;
+
+ first = false;
}
/* IDENT */
@@ -2216,14 +2222,20 @@ css_error parse_cursor(css_language *c,
consumeWhitespace(vector, ctx);
- token = parserutils_vector_peek(vector, *ctx);
- if (token != NULL && tokenIsChar(token, '!')) {
- break;
- }
+ /* Expect ',' */
+ token = parserutils_vector_iterate(vector, ctx);
+ if (token == NULL || tokenIsChar(token, ',') == false)
+ return CSS_INVALID;
- first = false;
+ consumeWhitespace(vector, ctx);
+ /* Expect either URI or IDENT */
token = parserutils_vector_iterate(vector, ctx);
+ if (token == NULL || (token->type != CSS_TOKEN_IDENT &&
+ token->type != CSS_TOKEN_URI))
+ return CSS_INVALID;
+
+ first = false;
}
/* IDENT */