summaryrefslogtreecommitdiff
path: root/render/html.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-11-07 12:33:34 +0000
committerVincent Sanders <vince@kyllikki.org>2014-11-07 12:33:34 +0000
commit3405803280c9cafab0a4ef229faa4bc447e4c953 (patch)
treeac7d85272d21ec15cec1825a2ea6b43f7b4cf11b /render/html.c
parent6993e842d902e363d44014fa514c91ca30896555 (diff)
downloadnetsurf-3405803280c9cafab0a4ef229faa4bc447e4c953.tar.gz
netsurf-3405803280c9cafab0a4ef229faa4bc447e4c953.tar.bz2
Improve content encoding information API
Extend the content_get_encoding() API to retrieve the source of the encoding as well as the actual encoding.
Diffstat (limited to 'render/html.c')
-rw-r--r--render/html.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/render/html.c b/render/html.c
index 4e9347aa5..a3474c7ad 100644
--- a/render/html.c
+++ b/render/html.c
@@ -2128,29 +2128,21 @@ struct box *html_get_box_tree(hlcache_handle *h)
* \param c Content to retrieve charset from
* \return Pointer to charset, or NULL
*/
-static const char *html_encoding(const struct content *c)
+static const char *html_encoding(const struct content *c, enum content_encoding_type op)
{
html_content *html = (html_content *) c;
assert(html != NULL);
+ if (op == CONTENT_ENCODING_SOURCE) {
+ char enc_token[10] = "Encoding0";
+ enc_token[8] = '0' + html->encoding_source;
+ return messages_get(enc_token);
+ }
+
return html->encoding;
}
-/**
- * Retrieve the charset of an HTML document
- *
- * \param h Content to retrieve charset from
- * \return Pointer to charset, or NULL
- */
-dom_hubbub_encoding_source html_get_encoding_source(hlcache_handle *h)
-{
- html_content *c = (html_content *) hlcache_handle_get_content(h);
-
- assert(c != NULL);
-
- return c->encoding_source;
-}
/**
* Retrieve framesets used in an HTML document