diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2007-01-03 20:11:09 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2007-01-03 20:11:09 +0000 |
commit | 4f1ca7d14c5ddee7138b57885dd4c1da05abbb3a (patch) | |
tree | 95b62ac8b5fa977ec58a7dff03c606f4a4f1f894 /render | |
parent | 0b875957cbf20593e5968ed29d9ccbbd2ff1a337 (diff) | |
download | netsurf-4f1ca7d14c5ddee7138b57885dd4c1da05abbb3a.tar.gz netsurf-4f1ca7d14c5ddee7138b57885dd4c1da05abbb3a.tar.bz2 |
Don't require frames to specify a URL (fixes frame names not being recognised)
svn path=/trunk/netsurf/; revision=3135
Diffstat (limited to 'render')
-rw-r--r-- | render/box_construct.c | 35 |
1 files 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; } } |