summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-06-27 12:31:29 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-06-27 12:31:29 +0000
commit2a486519aa8cb98daf01f1e1eb579c1c1858f245 (patch)
tree2d36df04c44fb036669d8a657d91733f80a8a06c /src
parent3fd462ecc01731f1b8e69a33ca4759b14a1bd851 (diff)
downloadlibcss-2a486519aa8cb98daf01f1e1eb579c1c1858f245.tar.gz
libcss-2a486519aa8cb98daf01f1e1eb579c1c1858f245.tar.bz2
Fix padding shorthand parser in the face of inherit.
Document same fix to margin shorthand parser. svn path=/trunk/libcss/; revision=8049
Diffstat (limited to 'src')
-rw-r--r--src/parse/properties/margin.c1
-rw-r--r--src/parse/properties/padding.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/src/parse/properties/margin.c b/src/parse/properties/margin.c
index 764177e..3479abf 100644
--- a/src/parse/properties/margin.c
+++ b/src/parse/properties/margin.c
@@ -87,6 +87,7 @@ css_error parse_margin(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]) {
diff --git a/src/parse/properties/padding.c b/src/parse/properties/padding.c
index d018609..507159d 100644
--- a/src/parse/properties/padding.c
+++ b/src/parse/properties/padding.c
@@ -87,6 +87,14 @@ css_error parse_padding(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_padding_side(c, vector, ctx,
CSS_PROP_PADDING_TOP, &top)) == CSS_OK) {