Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/8bccf1615876f7c0ddf62...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/8bccf1615876f7c0ddf62c0...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/8bccf1615876f7c0ddf62c05f...
The branch, master has been updated
via 8bccf1615876f7c0ddf62c05f1b9fbc78b011b94 (commit)
from 7d83151d1adb03eaa28df9ae05d0d8e8fb7e7f54 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commitdiff/8bccf1615876f7c0ddf...
commit 8bccf1615876f7c0ddf62c05f1b9fbc78b011b94
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Check if box with imagemap at point has area at point.
diff --git a/render/html.c b/render/html.c
index f6e3fda..6c6dcdf 100644
--- a/render/html.c
+++ b/render/html.c
@@ -2622,9 +2622,12 @@ html_get_contextual_content(struct content *c,
if (box->usemap) {
const char *target = NULL;
- data->link_url = nsurl_access(imagemap_get(html,
- box->usemap, box_x, box_y, x, y,
- &target));
+ nsurl *url = imagemap_get(html, box->usemap, box_x,
+ box_y, x, y, &target);
+ /* Box might have imagemap, but no actual link area
+ * at point */
+ if (url != NULL)
+ data->link_url = nsurl_access(url);
}
if (box->gadget) {
switch (box->gadget->type) {
diff --git a/utils/nsurl.c b/utils/nsurl.c
index eeaf202..18577b6 100644
--- a/utils/nsurl.c
+++ b/utils/nsurl.c
@@ -1564,9 +1564,7 @@ bool nsurl_has_component(const nsurl *url, nsurl_component part)
/* exported interface, documented in nsurl.h */
const char *nsurl_access(const nsurl *url)
{
- if (url == NULL) {
- return NULL;
- }
+ assert(url != NULL);
return url->string;
}
-----------------------------------------------------------------------
Summary of changes:
render/html.c | 9 ++++++---
utils/nsurl.c | 4 +---
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/render/html.c b/render/html.c
index f6e3fda..6c6dcdf 100644
--- a/render/html.c
+++ b/render/html.c
@@ -2622,9 +2622,12 @@ html_get_contextual_content(struct content *c,
if (box->usemap) {
const char *target = NULL;
- data->link_url = nsurl_access(imagemap_get(html,
- box->usemap, box_x, box_y, x, y,
- &target));
+ nsurl *url = imagemap_get(html, box->usemap, box_x,
+ box_y, x, y, &target);
+ /* Box might have imagemap, but no actual link area
+ * at point */
+ if (url != NULL)
+ data->link_url = nsurl_access(url);
}
if (box->gadget) {
switch (box->gadget->type) {
diff --git a/utils/nsurl.c b/utils/nsurl.c
index eeaf202..18577b6 100644
--- a/utils/nsurl.c
+++ b/utils/nsurl.c
@@ -1564,9 +1564,7 @@ bool nsurl_has_component(const nsurl *url, nsurl_component part)
/* exported interface, documented in nsurl.h */
const char *nsurl_access(const nsurl *url)
{
- if (url == NULL) {
- return NULL;
- }
+ assert(url != NULL);
return url->string;
}
--
NetSurf Browser