diff options
author | Dom Lachowicz <doml@src.gnome.org> | 2003-01-27 23:33:14 +0000 |
---|---|---|
committer | Dom Lachowicz <doml@src.gnome.org> | 2003-01-27 23:33:14 +0000 |
commit | 7c72654bf03ae8d8c8a057c2117c94509d104a02 (patch) | |
tree | d084216aaa889a30aeb60c820aca3ed2ca3fa1b4 | |
parent | 034f74d20b054eecbead90d19b1232a32891b616 (diff) | |
download | librsvg-7c72654bf03ae8d8c8a057c2117c94509d104a02.tar.gz |
Allow multiple declarations to be
additive ( H1 { font-weight: bold } H1 { font-family: Times } now
evaluate properly to H1 { font-weight: bold ; font-family: Times })
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | rsvg-styles.c | 14 |
2 files changed, 19 insertions, 3 deletions
@@ -1,5 +1,13 @@ 2003-01-27 Dom Lachowicz <cinamod@hotmail.com> + * rsvg-styles.c (parse_cssbuffer): Allow multiple declarations to be + additive ( H1 { font-weight: bold } H1 { font-family: Times } now + evaluate properly to H1 { font-weight: bold ; font-family: Times }) + +=== librsvg 2.2.1 === + +2003-01-27 Dom Lachowicz <cinamod@hotmail.com> + * rsvg.c (): Patheticly handle conical gradients (not part of SVG spec, but that doesn't stop KIllustrator/Kontour...), work on gradientTransform as well as spreads on radialGradients diff --git a/rsvg-styles.c b/rsvg-styles.c index 1d68d689..8fd5eb05 100644 --- a/rsvg-styles.c +++ b/rsvg-styles.c @@ -354,6 +354,8 @@ rsvg_parse_style (RsvgHandle *ctx, RsvgState *state, const char *str) /* * Extremely poor man's CSS parser. Not robust. Not compliant. * Should work well enough for our needs ;-) + * See also: http://www.w3.org/TR/REC-CSS2/syndata.html + * I should use that sometime in order to make a complaint parser */ void rsvg_parse_cssbuffer (RsvgHandle *ctx, const char * buff, size_t buflen) @@ -362,9 +364,10 @@ rsvg_parse_cssbuffer (RsvgHandle *ctx, const char * buff, size_t buflen) while (loc < buflen) { - GString * style_name = g_string_new (NULL); + GString * style_name = g_string_new (NULL); GString * style_props = g_string_new (NULL); - + GString * existing = NULL; + /* advance to the style's name */ while (loc < buflen && g_ascii_isspace (buff[loc])) loc++; @@ -399,8 +402,13 @@ rsvg_parse_cssbuffer (RsvgHandle *ctx, const char * buff, size_t buflen) } /* push name/style pair into HT */ + existing = g_hash_table_lookup (ctx->css_props, style_name->str); + if (existing != NULL) + g_string_append_len (style_props, existing->str, existing->len); + + /* will destroy the existing key and value for us */ g_hash_table_insert (ctx->css_props, style_name->str, style_props->str); - + g_string_free (style_name, FALSE); g_string_free (style_props, FALSE); |