Author: rjw
Date: Wed Jan 3 20:11:09 2007
New Revision: 3135
URL:
http://svn.semichrome.net?rev=3135&view=rev
Log:
Don't require frames to specify a URL (fixes frame names not being recognised)
Modified:
trunk/netsurf/render/box_construct.c
Modified: trunk/netsurf/render/box_construct.c
URL:
http://svn.semichrome.net/trunk/netsurf/render/box_construct.c?rev=3135&a...
==============================================================================
--- trunk/netsurf/render/box_construct.c (original)
+++ trunk/netsurf/render/box_construct.c Wed Jan 3 20:11:09 2007
@@ -1745,32 +1745,24 @@
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 @@
xmlFree(s);
}
- /* release temporary memory */
- free(url);
+ /* advance */
c = c->next;
}
}