diff options
Diffstat (limited to 'render/box.c')
-rw-r--r-- | render/box.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/render/box.c b/render/box.c index d694481a1..015af7411 100644 --- a/render/box.c +++ b/render/box.c @@ -190,6 +190,7 @@ struct box * box_create(struct css_style * style, box->col = 0; box->font = 0; box->gadget = 0; + box->usemap = 0; box->object = 0; #ifdef WITH_PLUGIN box->object_params = 0; @@ -771,7 +772,7 @@ struct result box_image(xmlNode *n, struct status *status, struct css_style *style) { struct box *box; - char *s, *url, *s1; + char *s, *url, *s1, *map; xmlChar *s2; box = box_create(style, status->href, status->title, @@ -789,6 +790,17 @@ struct result box_image(xmlNode *n, struct status *status, if (!(s = (char *) xmlGetProp(n, (const xmlChar *) "src"))) return (struct result) {box, 0}; + /* imagemap associated with this image */ + if ((map = xmlGetProp(n, (const xmlChar *) "usemap"))) { + if (map[0] == '#') { + box->usemap = xstrdup(map+1); + } + else { + box->usemap = xstrdup(map); + } + xmlFree(map); + } + /* remove leading and trailing whitespace */ s1 = strip(s); @@ -1764,6 +1776,8 @@ void box_free_box(struct box *box) free(box->style); } + if (box->usemap) + free(box->usemap); free(box->text); /* TODO: free object_params */ } @@ -1779,7 +1793,7 @@ struct result box_object(xmlNode *n, struct status *status, struct box *box; struct object_params *po; struct plugin_params* pp; - char *s, *url = NULL; + char *s, *url = NULL, *map; xmlNode *c; box = box_create(style, status->href, 0, @@ -1808,6 +1822,17 @@ struct result box_object(xmlNode *n, struct status *status, xmlFree(s); } + /* imagemap associated with this object */ + if ((map = xmlGetProp(n, (const xmlChar *) "usemap"))) { + if (map[0] == '#') { + box->usemap = xstrdup(map+1); + } + else { + box->usemap = xstrdup(map); + } + xmlFree(map); + } + /* object type */ if ((s = (char *) xmlGetProp(n, (const xmlChar *) "type"))) { |