summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2007-01-03 20:11:09 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2007-01-03 20:11:09 +0000
commit4f1ca7d14c5ddee7138b57885dd4c1da05abbb3a (patch)
tree95b62ac8b5fa977ec58a7dff03c606f4a4f1f894 /render
parent0b875957cbf20593e5968ed29d9ccbbd2ff1a337 (diff)
downloadnetsurf-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.c35
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;
}
}