From 3dcf7d80a140d5c02a56423dbc3575bbdf51ff82 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 21 Jan 2016 14:09:57 +0000 Subject: Pass html_content to box_extract_link. --- render/box_construct.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'render/box_construct.c') diff --git a/render/box_construct.c b/render/box_construct.c index 2ad5eb26c..ad39684a1 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -1476,7 +1476,7 @@ bool box_a(BOX_SPECIAL_PARAMS) err = dom_element_get_attribute(n, corestring_dom_href, &s); if (err == DOM_NO_ERR && s != NULL) { - ok = box_extract_link(dom_string_data(s), + ok = box_extract_link(content, dom_string_data(s), content->base_url, &url); dom_string_unref(s); if (!ok) @@ -1590,7 +1590,7 @@ bool box_image(BOX_SPECIAL_PARAMS) if (err != DOM_NO_ERR || s == NULL) return true; - if (box_extract_link(dom_string_data(s), content->base_url, + if (box_extract_link(content, dom_string_data(s), content->base_url, &url) == false) { dom_string_unref(s); return false; @@ -1691,7 +1691,7 @@ bool box_object(BOX_SPECIAL_PARAMS) * (codebase is the base for the other two) */ err = dom_element_get_attribute(n, corestring_dom_codebase, &codebase); if (err == DOM_NO_ERR && codebase != NULL) { - if (box_extract_link(dom_string_data(codebase), + if (box_extract_link(content, dom_string_data(codebase), content->base_url, ¶ms->codebase) == false) { dom_string_unref(codebase); @@ -1704,8 +1704,8 @@ bool box_object(BOX_SPECIAL_PARAMS) err = dom_element_get_attribute(n, corestring_dom_classid, &classid); if (err == DOM_NO_ERR && classid != NULL) { - if (box_extract_link(dom_string_data(classid), params->codebase, - ¶ms->classid) == false) { + if (box_extract_link(content, dom_string_data(classid), + params->codebase, ¶ms->classid) == false) { dom_string_unref(classid); return false; } @@ -1714,8 +1714,8 @@ bool box_object(BOX_SPECIAL_PARAMS) err = dom_element_get_attribute(n, corestring_dom_data, &data); if (err == DOM_NO_ERR && data != NULL) { - if (box_extract_link(dom_string_data(data), params->codebase, - ¶ms->data) == false) { + if (box_extract_link(content, dom_string_data(data), + params->codebase, ¶ms->data) == false) { dom_string_unref(data); return false; } @@ -2134,7 +2134,7 @@ bool box_create_frameset(struct content_html_frames *f, dom_node *n, url = NULL; err = dom_element_get_attribute(c, corestring_dom_src, &s); if (err == DOM_NO_ERR && s != NULL) { - box_extract_link(dom_string_data(s), + box_extract_link(content, dom_string_data(s), content->base_url, &url); dom_string_unref(s); } @@ -2270,7 +2270,7 @@ bool box_iframe(BOX_SPECIAL_PARAMS) err = dom_element_get_attribute(n, corestring_dom_src, &s); if (err != DOM_NO_ERR || s == NULL) return true; - if (box_extract_link(dom_string_data(s), content->base_url, + if (box_extract_link(content, dom_string_data(s), content->base_url, &url) == false) { dom_string_unref(s); return false; @@ -2843,7 +2843,7 @@ bool box_embed(BOX_SPECIAL_PARAMS) err = dom_element_get_attribute(n, corestring_dom_src, &src); if (err != DOM_NO_ERR || src == NULL) return true; - if (box_extract_link(dom_string_data(src), content->base_url, + if (box_extract_link(content, dom_string_data(src), content->base_url, ¶ms->data) == false) { dom_string_unref(src); return false; @@ -2996,7 +2996,8 @@ bool box_get_attribute(dom_node *n, const char *attribute, * \return true on success, false on memory exhaustion */ -bool box_extract_link(const char *rel, nsurl *base, nsurl **result) +bool box_extract_link(const html_content *content, + const char *rel, nsurl *base, nsurl **result) { char *s, *s1, *apos0 = 0, *apos1 = 0, *quot0 = 0, *quot1 = 0; unsigned int i, j, end; -- cgit v1.2.3