diff options
Diffstat (limited to 'src/parse')
-rw-r--r-- | src/parse/language.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/parse/language.c b/src/parse/language.c index 37edad8..c031bd4 100644 --- a/src/parse/language.c +++ b/src/parse/language.c @@ -1029,6 +1029,7 @@ css_error parseProperty(css_language *c, const css_token *property, int i = 0; uint8_t flags = 0; css_style *style = NULL; + const css_token *token; /* Find property index */ /** \todo improve on this linear search */ @@ -1050,13 +1051,22 @@ css_error parseProperty(css_language *c, const css_token *property, assert (style != NULL); - /* Determine if this is important or not */ + /* Determine if this declaration is important or not */ error = parse_important(c, vector, ctx, &flags); if (error != CSS_OK) { css_stylesheet_style_destroy(c->sheet, style); return error; } + /* Ensure that we've exhausted all the input */ + consumeWhitespace(vector, ctx); + token = parserutils_vector_iterate(vector, ctx); + if (token != NULL) { + /* Trailing junk, so discard declaration */ + css_stylesheet_style_destroy(c->sheet, style); + return CSS_INVALID; + } + /* If it's important, then mark the style appropriately */ if (flags != 0) make_style_important(style); |