summaryrefslogtreecommitdiff
path: root/source/html/css-parse.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-05-18 17:31:57 +0200
committerTor Andersson <tor.andersson@artifex.com>2015-05-19 16:22:57 +0200
commitc59e315a56d5f463ac329cb893082f06126d8660 (patch)
tree1af3d16532d7f7d295b8059c73af423f6b74e98f /source/html/css-parse.c
parent5fbb1782eeb9a423799e4f4d98daf50fc25580a2 (diff)
downloadmupdf-c59e315a56d5f463ac329cb893082f06126d8660.tar.xz
epub: Support !important property declarations.
Diffstat (limited to 'source/html/css-parse.c')
-rw-r--r--source/html/css-parse.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/html/css-parse.c b/source/html/css-parse.c
index e57eb798..0946043e 100644
--- a/source/html/css-parse.c
+++ b/source/html/css-parse.c
@@ -58,6 +58,7 @@ static fz_css_property *fz_new_css_property(fz_context *ctx, const char *name, f
prop->name = fz_strdup(ctx, name);
prop->value = value;
prop->spec = spec;
+ prop->important = 0;
prop->next = NULL;
return prop;
}
@@ -610,7 +611,11 @@ static fz_css_property *parse_declaration(struct lexbuf *buf)
/* !important */
if (accept(buf, '!'))
{
- expect(buf, CSS_KEYWORD);
+ white(buf);
+ if (buf->lookahead != CSS_KEYWORD || strcmp(buf->string, "important"))
+ fz_css_error(buf, "expected keyword 'important' after '!'");
+ p->important = 1;
+ next(buf);
white(buf);
}