diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-06-27 16:32:31 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-06-27 16:32:31 +0000 |
commit | 5dd7e9d762f8ae3535857ab9b4756d84bc29bcc0 (patch) | |
tree | 76be54d8eeccc65163bfd31903aa545b084d93c8 /src | |
parent | 03ef066be45b8a30f2e3e7cb4ad662b8c0e237ec (diff) | |
download | libcss-5dd7e9d762f8ae3535857ab9b4756d84bc29bcc0.tar.gz libcss-5dd7e9d762f8ae3535857ab9b4756d84bc29bcc0.tar.bz2 |
Fix border + outline shorthand property parsers
svn path=/trunk/libcss/; revision=8066
Diffstat (limited to 'src')
-rw-r--r-- | src/parse/properties/border_outline.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/parse/properties/border_outline.c b/src/parse/properties/border_outline.c index 2de19c8..4fd73da 100644 --- a/src/parse/properties/border_outline.c +++ b/src/parse/properties/border_outline.c @@ -338,6 +338,14 @@ css_error parse_border_color(css_language *c, prev_ctx = *ctx; error = CSS_OK; + /* 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]) { + error = CSS_INVALID; + goto cleanup; + } + if (top == NULL && (error = parse_border_side_color(c, vector, ctx, CSS_PROP_BORDER_TOP_COLOR, &top)) == @@ -877,6 +885,14 @@ css_error parse_border_style(css_language *c, prev_ctx = *ctx; error = CSS_OK; + /* 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]) { + error = CSS_INVALID; + goto cleanup; + } + if (top == NULL && (error = parse_border_side_style(c, vector, ctx, CSS_PROP_BORDER_TOP_STYLE, &top)) == @@ -1203,6 +1219,14 @@ css_error parse_border_width(css_language *c, prev_ctx = *ctx; error = CSS_OK; + /* 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]) { + error = CSS_INVALID; + goto cleanup; + } + if (top == NULL && (error = parse_border_side_width(c, vector, ctx, CSS_PROP_BORDER_TOP_WIDTH, &top)) == @@ -1438,6 +1462,14 @@ css_error parse_outline(css_language *c, prev_ctx = *ctx; error = CSS_OK; + /* 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]) { + error = CSS_INVALID; + goto cleanup; + } + if (color == NULL && (error = parse_outline_color(c, vector, ctx, &color)) == CSS_OK) { @@ -1751,6 +1783,14 @@ css_error parse_border_side(css_language *c, prev_ctx = *ctx; error = CSS_OK; + /* 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]) { + error = CSS_INVALID; + goto cleanup; + } + if (color == NULL && (error = parse_border_side_color(c, vector, ctx, CSS_PROP_BORDER_TOP_COLOR + side, &color)) == |