summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/parse/properties/font.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/parse/properties/font.c b/src/parse/properties/font.c
index 1d16d5a..4c8d120 100644
--- a/src/parse/properties/font.c
+++ b/src/parse/properties/font.c
@@ -89,6 +89,14 @@ css_error parse_font(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 (style == NULL &&
(error = parse_font_style(c, vector,
ctx, &style)) == CSS_OK) {
@@ -114,6 +122,14 @@ css_error parse_font(css_language *c,
consumeWhitespace(vector, ctx);
+ /* 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;
+ }
+
/* Now expect a font-size */
error = parse_font_size(c, vector, ctx, &size);
if (error != CSS_OK)
@@ -128,6 +144,14 @@ css_error parse_font(css_language *c,
consumeWhitespace(vector, ctx);
+ /* 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;
+ }
+
error = parse_line_height(c, vector, ctx, &line_height);
if (error != CSS_OK)
goto cleanup;
@@ -135,6 +159,14 @@ css_error parse_font(css_language *c,
consumeWhitespace(vector, ctx);
+ /* 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;
+ }
+
/* Now expect a font-family */
error = parse_font_family(c, vector, ctx, &family);
if (error != CSS_OK)