summaryrefslogtreecommitdiff
path: root/render/html.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-11-05 23:44:31 +0000
committerVincent Sanders <vince@kyllikki.org>2014-11-05 23:44:31 +0000
commit8ec7ad053a9a291ea2619055b1ca1989d4c975b9 (patch)
treeaa7272b673e2062985667d87fcfe7e19f30eb239 /render/html.c
parent4ca959f46baf18213bf5ded769d87c7f030d392f (diff)
downloadnetsurf-8ec7ad053a9a291ea2619055b1ca1989d4c975b9.tar.gz
netsurf-8ec7ad053a9a291ea2619055b1ca1989d4c975b9.tar.bz2
Make the fetching of a contents encoding generic.
The frontends previously had to use an html renderer API to get the encoding of a content. This also required the explicit checking of the contents type rather than using the existing content API to abstract this knowledge.
Diffstat (limited to 'render/html.c')
-rw-r--r--render/html.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/render/html.c b/render/html.c
index 854d892cd..d4ce3366f 100644
--- a/render/html.c
+++ b/render/html.c
@@ -2109,16 +2109,16 @@ struct box *html_get_box_tree(hlcache_handle *h)
/**
* Retrieve the charset of an HTML document
*
- * \param h Content to retrieve charset from
+ * \param c Content to retrieve charset from
* \return Pointer to charset, or NULL
*/
-const char *html_get_encoding(hlcache_handle *h)
+static const char *html_encoding(const struct content *c)
{
- html_content *c = (html_content *) hlcache_handle_get_content(h);
+ html_content *html = (html_content *) c;
- assert(c != NULL);
+ assert(html != NULL);
- return c->encoding;
+ return html->encoding;
}
/**
@@ -2262,6 +2262,7 @@ static const content_handler html_content_handler = {
.search_clear = html_search_clear,
.debug_dump = html_debug_dump,
.clone = html_clone,
+ .get_encoding = html_encoding,
.type = html_content_type,
.no_share = true,
};