diff options
Diffstat (limited to 'css')
-rw-r--r-- | css/css.c | 7 | ||||
-rw-r--r-- | css/css.h | 4 |
2 files changed, 7 insertions, 4 deletions
@@ -96,6 +96,8 @@ nserror nscss_create_css_data(struct content_css_data *c, c->import_count = 0; c->imports = NULL; + if (charset != NULL) + c->charset = strdup(charset); error = css_stylesheet_create(CSS_LEVEL_21, charset, url, NULL, quirks, false, @@ -328,6 +330,8 @@ void nscss_destroy_css_data(struct content_css_data *c) css_stylesheet_destroy(c->sheet); c->sheet = NULL; } + + free(c->charset); } bool nscss_clone(const struct content *old, struct content *new_content) @@ -336,10 +340,9 @@ bool nscss_clone(const struct content *old, struct content *new_content) unsigned long size; /* Simply replay create/process/convert */ - /** \todo We need the charset of the old sheet */ if (nscss_create_css_data(&new_content->data.css, content__get_url(new_content), - NULL, new_content->quirks) != NSERROR_OK) + old->data.css.charset, new_content->quirks) != NSERROR_OK) return false; data = content__get_source_data(new_content, &size); @@ -36,8 +36,8 @@ struct nscss_import; struct content_css_data { css_stylesheet *sheet; /**< Stylesheet object */ - - uint32_t import_count; /**< Number of sheets imported */ + char *charset; /**< Character set of stylesheet */ + uint32_t import_count; /**< Number of sheets imported */ struct nscss_import *imports; /**< Array of imported sheets */ }; |