summaryrefslogtreecommitdiff
path: root/src/parse/css21.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-10-23 00:28:20 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-10-23 00:28:20 +0000
commitc8e73871f9006987983fd1010d97b6168c13f6a3 (patch)
tree2fb79379af6643828fb93bd6c855a6e0a5e6dc7b /src/parse/css21.c
parent5d9507591d83b48be8c76421b602500c196e3785 (diff)
downloadlibcss-c8e73871f9006987983fd1010d97b6168c13f6a3.tar.gz
libcss-c8e73871f9006987983fd1010d97b6168c13f6a3.tar.bz2
Something approximating a parser for clear.
Provide API to create/destroy css_styles and append them to css_rules. svn path=/trunk/libcss/; revision=5625
Diffstat (limited to 'src/parse/css21.c')
-rw-r--r--src/parse/css21.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/parse/css21.c b/src/parse/css21.c
index 7f49490..7f16c8d 100644
--- a/src/parse/css21.c
+++ b/src/parse/css21.c
@@ -1067,7 +1067,7 @@ css_error parseProperty(css_css21 *c, const css_token *property,
css_error error;
css_prop_handler handler = NULL;
int i = 0;
- css_style *style;
+ css_style *style = NULL;
/* Find property index */
/** \todo improve on this linear search */
@@ -1087,8 +1087,18 @@ css_error parseProperty(css_css21 *c, const css_token *property,
if (error != CSS_OK)
return error;
- /** \todo append style to rule */
- UNUSED(rule);
+ /** \todo we should probably assert this, but until we've implemented
+ * all the property parsers, this will have to suffice. */
+ if (style != NULL) {
+ /* Append style to rule */
+ error = css_stylesheet_rule_append_style(c->sheet, rule, style);
+ if (error != CSS_OK) {
+ css_stylesheet_style_destroy(c->sheet, style);
+ return error;
+ }
+ }
+
+ /* Style owned or destroyed by stylesheet, so forget about it */
return CSS_OK;
}