From 4ff509a419cf48774d31f27e11a59edef1fd52d2 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 18 Jun 2009 20:07:47 +0000 Subject: Centralise !important handling. Document background-attachment parser and make it behave correctly. svn path=/trunk/libcss/; revision=7856 --- src/parse/language.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/parse/language.c') diff --git a/src/parse/language.c b/src/parse/language.c index 5097feb..37edad8 100644 --- a/src/parse/language.c +++ b/src/parse/language.c @@ -12,10 +12,12 @@ #include "stylesheet.h" #include "lex/lex.h" +#include "parse/important.h" #include "parse/language.h" #include "parse/parse.h" #include "parse/propstrings.h" #include "parse/properties/properties.h" +#include "parse/properties/utils.h" #include "utils/parserutilserror.h" #include "utils/utils.h" @@ -1025,6 +1027,7 @@ css_error parseProperty(css_language *c, const css_token *property, css_error error; css_prop_handler handler = NULL; int i = 0; + uint8_t flags = 0; css_style *style = NULL; /* Find property index */ @@ -1047,6 +1050,17 @@ css_error parseProperty(css_language *c, const css_token *property, assert (style != NULL); + /* Determine if this is important or not */ + error = parse_important(c, vector, ctx, &flags); + if (error != CSS_OK) { + css_stylesheet_style_destroy(c->sheet, style); + return error; + } + + /* If it's important, then mark the style appropriately */ + if (flags != 0) + make_style_important(style); + /* Append style to rule */ error = css_stylesheet_rule_append_style(c->sheet, rule, style); if (error != CSS_OK) { -- cgit v1.2.3