diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2011-10-06 23:31:55 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2011-10-06 23:31:55 +0000 |
commit | 52ad2c1e2523b28aa5363656fbbef20e97665cce (patch) | |
tree | 17fa08828007484f14e432f70347064b76108b95 /render/html.c | |
parent | 3fde9589c1ba89d16ec4d294fb308631f0257e3a (diff) | |
download | netsurf-52ad2c1e2523b28aa5363656fbbef20e97665cce.tar.gz netsurf-52ad2c1e2523b28aa5363656fbbef20e97665cce.tar.bz2 |
initial favicon support
svn path=/trunk/netsurf/; revision=12975
Diffstat (limited to 'render/html.c')
-rw-r--r-- | render/html.c | 45 |
1 files changed, 29 insertions, 16 deletions
diff --git a/render/html.c b/render/html.c index 93b34cafb..4c08a6620 100644 --- a/render/html.c +++ b/render/html.c @@ -810,6 +810,35 @@ bool html_head(html_content *c, xmlNode *head) } xmlFree(s); } + } else if (strcmp((const char *) node->name, "link") == 0) { + union content_msg_data msg_data; + char *href; + nserror error; + + href = (char *) xmlGetProp(node, (const xmlChar *) "href"); + if (href) { + error = nsurl_join(c->base_url, href, &msg_data.rfc5988_link.url); + + xmlFree(href); + } + + msg_data.rfc5988_link.rel = (char *)xmlGetProp(node, + (const xmlChar *)"rel"); + msg_data.rfc5988_link.type = (char *)xmlGetProp(node, + (const xmlChar *)"type"); + + content_broadcast(&c->base, CONTENT_MSG_LINK, msg_data); + + if (error == NSERROR_OK) { + nsurl_unref(msg_data.rfc5988_link.url); + } + if (msg_data.rfc5988_link.rel) { + xmlFree(msg_data.rfc5988_link.rel); + } + if (msg_data.rfc5988_link.type) { + xmlFree(msg_data.rfc5988_link.type); + } + } } return true; @@ -2385,22 +2414,6 @@ struct content_html_object *html_get_objects(hlcache_handle *h, unsigned int *n) } /** - * Retrieve favicon associated with an HTML document - * - * \param h HTML document to retrieve favicon from - * \return Pointer to favicon, or NULL if none - */ -hlcache_handle *html_get_favicon(hlcache_handle *h) -{ - html_content *c = (html_content *) hlcache_handle_get_content(h); - - assert(c != NULL); - - return NULL; -} - - -/** * Retrieve layout coordinates of box with given id * * \param h HTML document to search |