summaryrefslogtreecommitdiff
path: root/render/box.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-10-03 20:28:29 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-10-03 20:28:29 +0000
commit898b01e72163a53aac3a93bda5181b5897299cb1 (patch)
tree7e74675cf999d342806a3f9da02698a69565a659 /render/box.c
parentb9a40d8e47bac102c998b78b97d205886bc2dafb (diff)
downloadnetsurf-898b01e72163a53aac3a93bda5181b5897299cb1.tar.gz
netsurf-898b01e72163a53aac3a93bda5181b5897299cb1.tar.bz2
More conversion to nsurl. (box->href, object params, imagemaps, (i)frames)
svn path=/trunk/netsurf/; revision=12933
Diffstat (limited to 'render/box.c')
-rw-r--r--render/box.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/render/box.c b/render/box.c
index 00ba0852d..e26c2f565 100644
--- a/render/box.c
+++ b/render/box.c
@@ -86,6 +86,9 @@ static int box_talloc_destructor(struct box *b)
css_select_results_destroy(b->styles);
b->styles = NULL;
}
+
+ if (b->href != NULL)
+ nsurl_unref(b->href);
return 0;
}
@@ -96,7 +99,7 @@ static int box_talloc_destructor(struct box *b)
* \param styles selection results for the box, or NULL
* \param style computed style for the box (not copied), or 0
* \param style_owned whether style is owned by this box
- * \param href href for the box (not copied), or 0
+ * \param href href for the box (copied), or 0
* \param target target for the box (not copied), or 0
* \param title title for the box (not copied), or 0
* \param id id for the box (not copied), or 0
@@ -108,7 +111,7 @@ static int box_talloc_destructor(struct box *b)
*/
struct box * box_create(css_select_results *styles, css_computed_style *style,
- bool style_owned, const char *href, const char *target,
+ bool style_owned, nsurl *href, const char *target,
const char *title, char *id, void *context)
{
unsigned int i;
@@ -140,7 +143,7 @@ struct box * box_create(css_select_results *styles, css_computed_style *style,
box->text = NULL;
box->length = 0;
box->space = 0;
- box->href = href;
+ box->href = (href == NULL) ? NULL : nsurl_ref(href);
box->target = target;
box->title = title;
box->columns = 1;
@@ -943,7 +946,7 @@ void box_dump(FILE *stream, struct box *box, unsigned int depth)
if (box->style)
nscss_dump_computed_style(stream, box->style);
if (box->href)
- fprintf(stream, " -> '%s'", box->href);
+ fprintf(stream, " -> '%s'", nsurl_access(box->href));
if (box->target)
fprintf(stream, " |%s|", box->target);
if (box->title)