aboutsummaryrefslogtreecommitdiff
path: root/src/html.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-03-21 03:14:39 +0000
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-03-21 03:14:39 +0000
commitb95cea01b9a61c2f4e176b2e12acc4abef5d3d9d (patch)
tree69c346477f003ecac6648c2e4e69a3309520d7bd /src/html.cc
parentb49f9aff0d3a8d64768c265b877824124b5be4d3 (diff)
make drawing image map shapes work when <img> precedes <map>
http://lists.auriga.wearlab.de/pipermail/dillo-dev/2010-March/007406.html Johannes wrote the code, and I (corvid) added some big comments of the sort alluded to in that thread.
Diffstat (limited to 'src/html.cc')
-rw-r--r--src/html.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/html.cc b/src/html.cc
index be82fe7f..4a7b50f3 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -2199,6 +2199,17 @@ static void Html_tag_open_map(DilloHtml *html, const char *tag, int tagsize)
*/
static void Html_tag_close_map(DilloHtml *html, int TagIdx)
{
+ /* This is a hack for the perhaps frivolous feature of drawing image map
+ * shapes when there is no image to display. If this map is defined after
+ * an image that has not been loaded (img != NULL), tell the image to
+ * redraw. (It will only do so if it uses a map.)
+ */
+ for (int i = 0; i < html->images->size(); i++) {
+ DilloImage *img = html->images->get(i)->image;
+
+ if (img)
+ ((dw::Image*) img->dw)->forceMapRedraw();
+ }
html->InFlags &= ~IN_MAP;
}