From 4f1ca7d14c5ddee7138b57885dd4c1da05abbb3a Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Wed, 3 Jan 2007 20:11:09 +0000 Subject: Don't require frames to specify a URL (fixes frame names not being recognised) svn path=/trunk/netsurf/; revision=3135 --- render/box_construct.c | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/render/box_construct.c b/render/box_construct.c index 1f1cc86a4..37a649700 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -1745,32 +1745,24 @@ bool box_create_frameset(struct content_html_frames *f, xmlNode *n, continue; } - /* get frame URL */ - if (!(s = (char *) xmlGetProp(c, + /* get frame URL (not required) */ + url = NULL; + if ((s = (char *) xmlGetProp(c, (const xmlChar *) "src"))) { - c = c->next; - continue; - } - if (!box_extract_link(s, content->data.html.base_url, &url)) { + box_extract_link(s, content->data.html.base_url, &url); xmlFree(s); - c = c->next; - continue; } - xmlFree(s); - if (!url) { - c = c->next; - continue; - } - - /* don't include ourself */ - if (strcmp(content->data.html.base_url, url) == 0) { + + /* copy url */ + if (url) { + /* no self-references */ + if (strcmp(content->data.html.base_url, url)) + frame->url = talloc_strdup(content, url); free(url); - c = c->next; - continue; + url = NULL; } - + /* fill in specified values */ - frame->url = talloc_strdup(content, url); if ((s = (char *) xmlGetProp(c, (const xmlChar *) "name"))) { frame->name = talloc_strdup(content, s); @@ -1811,8 +1803,7 @@ bool box_create_frameset(struct content_html_frames *f, xmlNode *n, xmlFree(s); } - /* release temporary memory */ - free(url); + /* advance */ c = c->next; } } -- cgit v1.2.3