summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--css/css.c7
-rw-r--r--css/css.h4
2 files changed, 7 insertions, 4 deletions
diff --git a/css/css.c b/css/css.c
index d666b891f..99d31f857 100644
--- a/css/css.c
+++ b/css/css.c
@@ -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);
diff --git a/css/css.h b/css/css.h
index c95f87053..e192b969c 100644
--- a/css/css.h
+++ b/css/css.h
@@ -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 */
};