summaryrefslogtreecommitdiff
path: root/src/parse/language.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-06-18 20:07:47 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-06-18 20:07:47 +0000
commit4ff509a419cf48774d31f27e11a59edef1fd52d2 (patch)
tree42b86995bf3d9bb890e20a703b94acc0f2e538da /src/parse/language.c
parent2e21ea7e931bc501a6af8f1761d68407fb232731 (diff)
downloadlibcss-4ff509a419cf48774d31f27e11a59edef1fd52d2.tar.gz
libcss-4ff509a419cf48774d31f27e11a59edef1fd52d2.tar.bz2
Centralise !important handling.
Document background-attachment parser and make it behave correctly. svn path=/trunk/libcss/; revision=7856
Diffstat (limited to 'src/parse/language.c')
-rw-r--r--src/parse/language.c14
1 files changed, 14 insertions, 0 deletions
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) {